@transferwise/components 0.0.0-experimental-fcf3009 → 0.0.0-experimental-e153d25

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.js CHANGED
@@ -3354,6 +3354,9 @@ class DayCalendarTable extends React.PureComponent {
3354
3354
  onSelect(new Date(viewYear, viewMonth, day));
3355
3355
  };
3356
3356
  isDisabled = day => {
3357
+ if (day === -1) {
3358
+ return true;
3359
+ }
3357
3360
  const {
3358
3361
  min,
3359
3362
  max,
@@ -3369,7 +3372,7 @@ class DayCalendarTable extends React.PureComponent {
3369
3372
  viewMonth,
3370
3373
  viewYear
3371
3374
  } = this.props;
3372
- return !!(selectedDate && +new Date(viewYear, viewMonth, day) === +selectedDate);
3375
+ return !!(selectedDate && Number(new Date(viewYear, viewMonth, day)) === Number(selectedDate));
3373
3376
  };
3374
3377
  isToday = day => {
3375
3378
  const {
@@ -3763,8 +3766,8 @@ class DateLookup extends React.PureComponent {
3763
3766
  originalDate: null,
3764
3767
  min: getStartOfDay(props.min),
3765
3768
  max: getStartOfDay(props.max),
3766
- viewMonth: (props.value || new Date()).getMonth(),
3767
- viewYear: (props.value || new Date()).getFullYear(),
3769
+ viewMonth: (props.value || (props.min || props.max) && moveToWithinRange(new Date(), props.min, props.max) || new Date()).getMonth(),
3770
+ viewYear: (props.value || (props.min || props.max) && moveToWithinRange(new Date(), props.min, props.max) || new Date()).getFullYear(),
3768
3771
  open: false,
3769
3772
  mode: 'day',
3770
3773
  isMobile: false
@@ -3910,9 +3913,7 @@ class DateLookup extends React.PureComponent {
3910
3913
  } else {
3911
3914
  date = getStartOfDay(new Date());
3912
3915
  }
3913
- if (date) {
3914
- date = moveToWithinRange(date, min, max);
3915
- }
3916
+ date &&= moveToWithinRange(date, min, max);
3916
3917
  if (date?.getTime() !== selectedDate?.getTime()) {
3917
3918
  this.props.onChange(date);
3918
3919
  }