diff --git a/packages/react/src/components/DateTimePicker/DateTimePickerV2.test.jsx b/packages/react/src/components/DateTimePicker/DateTimePickerV2.test.jsx index df8fb6fc13..3206e830f8 100644 --- a/packages/react/src/components/DateTimePicker/DateTimePickerV2.test.jsx +++ b/packages/react/src/components/DateTimePicker/DateTimePickerV2.test.jsx @@ -2817,4 +2817,16 @@ describe('DateTimePickerV2', () => { expect(onApply).toHaveBeenCalledTimes(1); }); }); + + it('should render without a time picker and a mask that does not include time', () => { + render( + + ); + expect(screen.getByText(PRESET_VALUES[0].label)).toBeVisible(); + }); }); diff --git a/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx b/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx index 5a2ec88cde..28bc58227d 100644 --- a/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx +++ b/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx @@ -341,7 +341,7 @@ const DateTimePicker = ({ const is24hours = useMemo(() => { const [, time] = dateTimeMask.split(' '); const hoursMask = time?.split(':')[0]; - return hoursMask.includes('H'); + return hoursMask ? hoursMask.includes('H') : false; }, [dateTimeMask]); const isSingleSelect = useMemo(() => datePickerType === 'single', [datePickerType]); diff --git a/packages/react/src/components/DateTimePicker/dateTimePickerUtils.js b/packages/react/src/components/DateTimePicker/dateTimePickerUtils.js index 97457e7068..cf1e048a41 100644 --- a/packages/react/src/components/DateTimePicker/dateTimePickerUtils.js +++ b/packages/react/src/components/DateTimePicker/dateTimePickerUtils.js @@ -16,7 +16,7 @@ const { iotPrefix } = settings; const is24hours = (dateTimeMask) => { const [, time] = dateTimeMask.split(' '); const hoursMask = time?.split(':')[0]; - return hoursMask.includes('H'); + return hoursMask ? hoursMask.includes('H') : false; }; /** convert time from 12 hours to 24 hours, if time12hour is 24 hours format, return immediately diff --git a/packages/react/src/components/Header/_header.scss b/packages/react/src/components/Header/_header.scss index 12cb1629b2..dc33996a04 100644 --- a/packages/react/src/components/Header/_header.scss +++ b/packages/react/src/components/Header/_header.scss @@ -49,6 +49,10 @@ $hoverBgColor: #2c2c2c; &__menu-title[role='menuitem'][aria-expanded='true'] + &__menu { left: auto; right: 0; + [dir='rtl'] & { + left: 0; + right: auto; + } } &__menu {