@commercetools-uikit/date-time-input 20.2.0 → 20.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -205,7 +205,7 @@ let DateTimeInput = /*#__PURE__*/function (_Component) {
205
205
  timeString: changes.isOpen && this.props.value !== '' ? calendarTimeUtils.formatTime(this.props.value, this.props.intl.locale, this.props.timeZone) : this.state.timeString,
206
206
  // ensure calendar always opens on selected item, or on
207
207
  // current month when there is no selected item
208
- calendarDate: this.props.value === '' ? calendarTimeUtils.getToday(this.props.timeZone) : this.props.value
208
+ calendarDate: this.props.value === '' ? calendarTimeUtils.getToday(this.props.timeZone) : calendarTimeUtils.getStartOf(this.props.value, this.props.timeZone)
209
209
  };
210
210
  }
211
211
  if (changes.hasOwnProperty('highlightedIndex')) {
@@ -350,8 +350,8 @@ let DateTimeInput = /*#__PURE__*/function (_Component) {
350
350
  hasWarning: this.props.hasWarning,
351
351
  appearance: appearance,
352
352
  children: [jsxRuntime.jsx(calendarUtils.CalendarHeader, {
353
- monthLabel: calendarTimeUtils.getMonthCalendarLabel(this.state.calendarDate, this.props.intl.locale),
354
- yearLabel: calendarTimeUtils.getYearCalendarLabel(this.state.calendarDate, this.props.intl.locale),
353
+ monthLabel: calendarTimeUtils.getMonthCalendarLabel(this.state.calendarDate, this.props.intl.locale, this.props.timeZone),
354
+ yearLabel: calendarTimeUtils.getYearCalendarLabel(this.state.calendarDate, this.props.intl.locale, this.props.timeZone),
355
355
  onPrevMonthClick: () => this.jumpMonths(-1),
356
356
  onTodayClick: this.showToday,
357
357
  onNextMonthClick: () => this.jumpMonths(1),
@@ -408,7 +408,7 @@ DateTimeInput.displayName = 'DateTimeInput';
408
408
  var dateTimeInput = reactIntl.injectIntl(DateTimeInput);
409
409
 
410
410
  // NOTE: This string will be replaced on build time with the package version.
411
- var version = "20.2.0";
411
+ var version = "20.2.2";
412
412
 
413
413
  exports["default"] = dateTimeInput;
414
414
  exports.version = version;
@@ -203,7 +203,7 @@ let DateTimeInput = /*#__PURE__*/function (_Component) {
203
203
  timeString: changes.isOpen && this.props.value !== '' ? calendarTimeUtils.formatTime(this.props.value, this.props.intl.locale, this.props.timeZone) : this.state.timeString,
204
204
  // ensure calendar always opens on selected item, or on
205
205
  // current month when there is no selected item
206
- calendarDate: this.props.value === '' ? calendarTimeUtils.getToday(this.props.timeZone) : this.props.value
206
+ calendarDate: this.props.value === '' ? calendarTimeUtils.getToday(this.props.timeZone) : calendarTimeUtils.getStartOf(this.props.value, this.props.timeZone)
207
207
  };
208
208
  }
209
209
  if (changes.hasOwnProperty('highlightedIndex')) {
@@ -348,8 +348,8 @@ let DateTimeInput = /*#__PURE__*/function (_Component) {
348
348
  hasWarning: this.props.hasWarning,
349
349
  appearance: appearance,
350
350
  children: [jsxRuntime.jsx(calendarUtils.CalendarHeader, {
351
- monthLabel: calendarTimeUtils.getMonthCalendarLabel(this.state.calendarDate, this.props.intl.locale),
352
- yearLabel: calendarTimeUtils.getYearCalendarLabel(this.state.calendarDate, this.props.intl.locale),
351
+ monthLabel: calendarTimeUtils.getMonthCalendarLabel(this.state.calendarDate, this.props.intl.locale, this.props.timeZone),
352
+ yearLabel: calendarTimeUtils.getYearCalendarLabel(this.state.calendarDate, this.props.intl.locale, this.props.timeZone),
353
353
  onPrevMonthClick: () => this.jumpMonths(-1),
354
354
  onTodayClick: this.showToday,
355
355
  onNextMonthClick: () => this.jumpMonths(1),
@@ -406,7 +406,7 @@ DateTimeInput.displayName = 'DateTimeInput';
406
406
  var dateTimeInput = reactIntl.injectIntl(DateTimeInput);
407
407
 
408
408
  // NOTE: This string will be replaced on build time with the package version.
409
- var version = "20.2.0";
409
+ var version = "20.2.2";
410
410
 
411
411
  exports["default"] = dateTimeInput;
412
412
  exports.version = version;
@@ -21,7 +21,7 @@ import Downshift from 'downshift';
21
21
  import { injectIntl } from 'react-intl';
22
22
  import Constraints from '@commercetools-uikit/constraints';
23
23
  import { warning, filterDataAttributes, parseTime } from '@commercetools-uikit/utils';
24
- import { createItemDateTimeToString, formatTime, createSuggestedItems, getToday, createCalendarItems, getPaddingDayCount, getWeekdayNames, getLocalizedDateTimeFormatPattern, parseInputText, getPreviousDay, getDaysInMonth, changeTime, getMonthCalendarLabel, getYearCalendarLabel, isSameDay, getCalendarDayLabel, getDateInMonth, formatDefaultTime, changeMonth, getStartOf } from '@commercetools-uikit/calendar-time-utils';
24
+ import { createItemDateTimeToString, formatTime, createSuggestedItems, getToday, getStartOf, createCalendarItems, getPaddingDayCount, getWeekdayNames, getLocalizedDateTimeFormatPattern, parseInputText, getPreviousDay, getDaysInMonth, changeTime, getMonthCalendarLabel, getYearCalendarLabel, isSameDay, getCalendarDayLabel, getDateInMonth, formatDefaultTime, changeMonth } from '@commercetools-uikit/calendar-time-utils';
25
25
  import { CalendarBody, CalendarMenu, CalendarHeader, CalendarContent, CalendarDay } from '@commercetools-uikit/calendar-utils';
26
26
  import { css } from '@emotion/react';
27
27
  import { designTokens } from '@commercetools-uikit/design-system';
@@ -184,7 +184,7 @@ let DateTimeInput = /*#__PURE__*/function (_Component) {
184
184
  timeString: changes.isOpen && this.props.value !== '' ? formatTime(this.props.value, this.props.intl.locale, this.props.timeZone) : this.state.timeString,
185
185
  // ensure calendar always opens on selected item, or on
186
186
  // current month when there is no selected item
187
- calendarDate: this.props.value === '' ? getToday(this.props.timeZone) : this.props.value
187
+ calendarDate: this.props.value === '' ? getToday(this.props.timeZone) : getStartOf(this.props.value, this.props.timeZone)
188
188
  };
189
189
  }
190
190
  if (changes.hasOwnProperty('highlightedIndex')) {
@@ -329,8 +329,8 @@ let DateTimeInput = /*#__PURE__*/function (_Component) {
329
329
  hasWarning: this.props.hasWarning,
330
330
  appearance: appearance,
331
331
  children: [jsx(CalendarHeader, {
332
- monthLabel: getMonthCalendarLabel(this.state.calendarDate, this.props.intl.locale),
333
- yearLabel: getYearCalendarLabel(this.state.calendarDate, this.props.intl.locale),
332
+ monthLabel: getMonthCalendarLabel(this.state.calendarDate, this.props.intl.locale, this.props.timeZone),
333
+ yearLabel: getYearCalendarLabel(this.state.calendarDate, this.props.intl.locale, this.props.timeZone),
334
334
  onPrevMonthClick: () => this.jumpMonths(-1),
335
335
  onTodayClick: this.showToday,
336
336
  onNextMonthClick: () => this.jumpMonths(1),
@@ -387,6 +387,6 @@ DateTimeInput.displayName = 'DateTimeInput';
387
387
  var dateTimeInput = injectIntl(DateTimeInput);
388
388
 
389
389
  // NOTE: This string will be replaced on build time with the package version.
390
- var version = "20.2.0";
390
+ var version = "20.2.2";
391
391
 
392
392
  export { dateTimeInput as default, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/date-time-input",
3
3
  "description": "The `DateTimeInput` component allows the user to select a date. This component also supports multiple date selection.",
4
- "version": "20.2.0",
4
+ "version": "20.2.2",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,19 +21,19 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/accessible-button": "20.2.0",
25
- "@commercetools-uikit/calendar-time-utils": "20.2.0",
26
- "@commercetools-uikit/calendar-utils": "20.2.0",
27
- "@commercetools-uikit/constraints": "20.2.0",
28
- "@commercetools-uikit/design-system": "20.2.0",
29
- "@commercetools-uikit/hooks": "20.2.0",
30
- "@commercetools-uikit/icons": "20.2.0",
31
- "@commercetools-uikit/secondary-icon-button": "20.2.0",
32
- "@commercetools-uikit/select-utils": "20.2.0",
33
- "@commercetools-uikit/spacings-inline": "20.2.0",
34
- "@commercetools-uikit/text": "20.2.0",
35
- "@commercetools-uikit/tooltip": "20.2.0",
36
- "@commercetools-uikit/utils": "20.2.0",
24
+ "@commercetools-uikit/accessible-button": "20.2.2",
25
+ "@commercetools-uikit/calendar-time-utils": "20.2.2",
26
+ "@commercetools-uikit/calendar-utils": "20.2.2",
27
+ "@commercetools-uikit/constraints": "20.2.2",
28
+ "@commercetools-uikit/design-system": "20.2.2",
29
+ "@commercetools-uikit/hooks": "20.2.2",
30
+ "@commercetools-uikit/icons": "20.2.2",
31
+ "@commercetools-uikit/secondary-icon-button": "20.2.2",
32
+ "@commercetools-uikit/select-utils": "20.2.2",
33
+ "@commercetools-uikit/spacings-inline": "20.2.2",
34
+ "@commercetools-uikit/text": "20.2.2",
35
+ "@commercetools-uikit/tooltip": "20.2.2",
36
+ "@commercetools-uikit/utils": "20.2.2",
37
37
  "@emotion/react": "^11.10.5",
38
38
  "@emotion/styled": "^11.10.5",
39
39
  "downshift": "9.0.9",