Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DateTimePicker] Setting date range throws error when dateTimeMask does not include time part #3741

Open
1 of 2 tasks
navjeets opened this issue Mar 5, 2023 · 0 comments
Open
1 of 2 tasks
Assignees
Labels

Comments

@navjeets
Copy link
Contributor

navjeets commented Mar 5, 2023

What package is this for?

  • React
  • Angular

Describe the bug

If the dateTimeMask doesn't include the time part e.g. "MM/DD/YYYY", changing the range in DateTimePicker causes exception. Here's the stack trace

Uncaught TypeError: Cannot read properties of undefined (reading 'includes')
    at is24hours (dateTimePickerUtils.js:43:1)
    at parseValue (dateTimePickerUtils.js:149:1)
    at renderValue (DateTimePicker.js:462:1)
    at eval (DateTimePicker.js:469:1)
    at invokePassiveEffectCreate (react-dom.development.js:23487:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at flushPassiveEffectsImpl (react-dom.development.js:23574:1)
    at unstable_runWithPriority (scheduler.development.js:468:1)
    at runWithPriority$1 (react-dom.development.js:11276:1)
    at flushPassiveEffects (react-dom.development.js:23447:1)
    at performSyncWorkOnRoot (react-dom.development.js:22269:1)
    at eval (react-dom.development.js:11327:1)
    at unstable_runWithPriority (scheduler.development.js:468:1)
    at runWithPriority$1 (react-dom.development.js:11276:1)
    at flushSyncCallbackQueueImpl (react-dom.development.js:11322:1)
    at flushSyncCallbackQueue (react-dom.development.js:11309:1)
    at flushPassiveEffectsImpl (react-dom.development.js:23620:1)
    at unstable_runWithPriority (scheduler.development.js:468:1)
    at runWithPriority$1 (react-dom.development.js:11276:1)
    at flushPassiveEffects (react-dom.development.js:23447:1)
    at flushDiscreteUpdates (react-dom.development.js:22356:1)
    at flushDiscreteUpdatesIfNeeded (react-dom.development.js:3768:1)
    at dispatchDiscreteEvent (react-dom.development.js:5886:1)

To Reproduce

Steps to reproduce the behavior:

  1. Set the dateTimeMask to "MM/DD/YYYY" in DateTimePicker.
  2. Change the range in DateTimePicker.
  3. See the error.

Expected behavior

User should be able to set the dateTimeMaskin DateTimePicker to just date format.

Environment/versions:

  • OS: All
  • Browser: All
  • carbon-addons-iot-react version: v2.152.4

Additional context

This caused by changes in this commit -> cc20d6e#diff-b384b4bbb432ea7d7ff4e0a55b7c379c4261fcfaba975ad469c489f7530970f1

Specific timeline issues / requests

Do you want this work within a specific time period? Is it related to an
upcoming release?
The fix is required for MAS 8.10. Health defect -> https://github.ibm.com/maximo/Asset-Health-Insight/issues/13887

NB: The core contributors will try to work with your timeline, but it's not
guaranteed. The earlier you make a request in advance of a desired delivery
date, the better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants