@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.
@@ -2242,6 +2242,11 @@ function getYearInInterval(value, minDate, maxDate) {
2242
2242
  return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
2243
2243
  }
2244
2244
 
2245
+ function getValueToDisplayedString(value) {
2246
+ // We exclude the undefined value since 0 is a valid number
2247
+ if (value === undefined) return '';
2248
+ return value.toString();
2249
+ }
2245
2250
  var keyboardDatePickerReducer = function (state, action) {
2246
2251
  switch (action.type) {
2247
2252
  case 'day-change':
@@ -2249,7 +2254,7 @@ var keyboardDatePickerReducer = function (state, action) {
2249
2254
  var nextDay = action.nextDay;
2250
2255
  return _objectSpread(_objectSpread({}, state), {}, {
2251
2256
  currentDay: nextDay,
2252
- displayedDay: nextDay ? nextDay.toString() : ''
2257
+ displayedDay: getValueToDisplayedString(nextDay)
2253
2258
  });
2254
2259
  }
2255
2260
  case 'month-change':
@@ -2257,7 +2262,7 @@ var keyboardDatePickerReducer = function (state, action) {
2257
2262
  var nextMonth = action.nextMonth;
2258
2263
  return _objectSpread(_objectSpread({}, state), {}, {
2259
2264
  currentMonth: nextMonth,
2260
- displayedMonth: nextMonth ? nextMonth.toString() : ''
2265
+ displayedMonth: getValueToDisplayedString(nextMonth)
2261
2266
  });
2262
2267
  }
2263
2268
  case 'year-change':
@@ -2265,7 +2270,7 @@ var keyboardDatePickerReducer = function (state, action) {
2265
2270
  var nextYear = action.nextYear;
2266
2271
  return _objectSpread(_objectSpread({}, state), {}, {
2267
2272
  currentYear: nextYear,
2268
- displayedYear: nextYear ? nextYear.toString() : ''
2273
+ displayedYear: getValueToDisplayedString(nextYear)
2269
2274
  });
2270
2275
  }
2271
2276
  case 'day-blur':