@transferwise/components 0.0.0-experimental-954122c → 0.0.0-experimental-bb7ed4a

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.
package/build/index.mjs CHANGED
@@ -2579,6 +2579,10 @@ const isMonthAndYearFormat = dateString => validDateString(dateString) && dateSt
2579
2579
  const MDY = new Set(['en-US']);
2580
2580
  const YMD = new Set(['hu', 'hu-HU', 'zh-HK', 'zh-CN', 'ja', 'ja-JP']);
2581
2581
 
2582
+ const returnDateView = (selectedDate, min, max) => {
2583
+ return selectedDate || (min || max) && moveToWithinRange(new Date(), min, max) || new Date();
2584
+ };
2585
+
2582
2586
  var messages$9 = defineMessages({
2583
2587
  monthLabel: {
2584
2588
  id: "neptune.DateInput.month.label"
@@ -3735,8 +3739,8 @@ class DateLookup extends PureComponent {
3735
3739
  originalDate: null,
3736
3740
  min: getStartOfDay(props.min),
3737
3741
  max: getStartOfDay(props.max),
3738
- viewMonth: (props.value || (props.min || props.max) && moveToWithinRange(new Date(), props.min, props.max) || new Date()).getMonth(),
3739
- viewYear: (props.value || (props.min || props.max) && moveToWithinRange(new Date(), props.min, props.max) || new Date()).getFullYear(),
3742
+ viewMonth: returnDateView(props.value, props.min, props.max).getMonth(),
3743
+ viewYear: returnDateView(props.value, props.min, props.max).getFullYear(),
3740
3744
  open: false,
3741
3745
  mode: 'day',
3742
3746
  isMobile: false
@@ -3757,7 +3761,7 @@ class DateLookup extends PureComponent {
3757
3761
  props.onChange(moveToWithinRange(selectedDate, min, max));
3758
3762
  return null;
3759
3763
  }
3760
- const viewDateThatIsWithinRange = selectedDate || (min || max) && moveToWithinRange(new Date(), min, max) || new Date();
3764
+ const viewDateThatIsWithinRange = returnDateView(selectedDate, min, max);
3761
3765
  const viewMonth = viewDateThatIsWithinRange.getMonth();
3762
3766
  const viewYear = viewDateThatIsWithinRange.getFullYear();
3763
3767
  return {