How to use the react-day-picker.DateUtils.isDayBefore function in react-day-picker

To help you get started, we’ve selected a few react-day-picker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / lunar / packages / core / src / components / DatePicker / story.tsx View on Github external
isSelectingFirstDay(from: RangeState['from'], to: RangeState['to'], day: Date) {
    // @ts-ignore
    const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
    const isRangeSelected = from && to;

    return !from || isBeforeFirstDay || isRangeSelected;
  }
github callistusystan / Trippy / src / drawer / CalendarDrawer.js View on Github external
isSelectingFirstDay = (from, to, day) => {
        const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
        const isRangeSelected = from && to;
        return !from || isBeforeFirstDay || isRangeSelected;
    }
github urbica / ui-kit / src / components / DatePicker / DatePicker.js View on Github external
const isSelectingFirstDay = (from, to, day) => {
  const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
  const isRangeSelected = from && to;
  return !from || isBeforeFirstDay || isRangeSelected;
};
github gpbl / react-day-picker / docs / src / code-samples / examples / selected-range-enter.js View on Github external
isSelectingFirstDay(from, to, day) {
    const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
    const isRangeSelected = from && to;
    return !from || isBeforeFirstDay || isRangeSelected;
  }
github sentinel-hub / EOBrowser / src / components / search / SearchForm.js View on Github external
this.setState(oldState => {
      let oldTimeFrom = oldState.queryParams.timeFrom;
      if (DateUtils.isDayBefore(new Date(e), new Date(oldTimeFrom))) {
        oldTimeFrom = DateUtils.addMonths(new Date(e), -1);
      }
      return {
        queryParams: {
          ...oldState.queryParams,
          timeTo: moment(e),
          timeFrom: moment(oldTimeFrom),
        },
      };
    });
  }