@ornikar/kitt-universal 9.46.1 → 9.46.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.
@@ -2679,6 +2679,11 @@ function getYearInInterval(value, minDate, maxDate) {
2679
2679
  return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
2680
2680
  }
2681
2681
 
2682
+ function getValueToDisplayedString(value) {
2683
+ // We exclude the undefined value since 0 is a valid number
2684
+ if (value === undefined) return '';
2685
+ return value.toString();
2686
+ }
2682
2687
  var keyboardDatePickerReducer = function (state, action) {
2683
2688
  switch (action.type) {
2684
2689
  case 'day-change':
@@ -2686,7 +2691,7 @@ var keyboardDatePickerReducer = function (state, action) {
2686
2691
  var nextDay = action.nextDay;
2687
2692
  return _objectSpread(_objectSpread({}, state), {}, {
2688
2693
  currentDay: nextDay,
2689
- displayedDay: nextDay ? nextDay.toString() : ''
2694
+ displayedDay: getValueToDisplayedString(nextDay)
2690
2695
  });
2691
2696
  }
2692
2697
  case 'month-change':
@@ -2694,7 +2699,7 @@ var keyboardDatePickerReducer = function (state, action) {
2694
2699
  var nextMonth = action.nextMonth;
2695
2700
  return _objectSpread(_objectSpread({}, state), {}, {
2696
2701
  currentMonth: nextMonth,
2697
- displayedMonth: nextMonth ? nextMonth.toString() : ''
2702
+ displayedMonth: getValueToDisplayedString(nextMonth)
2698
2703
  });
2699
2704
  }
2700
2705
  case 'year-change':
@@ -2702,7 +2707,7 @@ var keyboardDatePickerReducer = function (state, action) {
2702
2707
  var nextYear = action.nextYear;
2703
2708
  return _objectSpread(_objectSpread({}, state), {}, {
2704
2709
  currentYear: nextYear,
2705
- displayedYear: nextYear ? nextYear.toString() : ''
2710
+ displayedYear: getValueToDisplayedString(nextYear)
2706
2711
  });
2707
2712
  }
2708
2713
  case 'day-blur':