Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}
isSelectingFirstDay = (from, to, day) => {
const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
const isRangeSelected = from && to;
return !from || isBeforeFirstDay || isRangeSelected;
}
const isSelectingFirstDay = (from, to, day) => {
const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
const isRangeSelected = from && to;
return !from || isBeforeFirstDay || isRangeSelected;
};
isSelectingFirstDay(from, to, day) {
const isBeforeFirstDay = from && DateUtils.isDayBefore(day, from);
const isRangeSelected = from && to;
return !from || isBeforeFirstDay || isRangeSelected;
}
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),
},
};
});
}