Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (result.start.isCertain('day') && !result.start.isCertain('month')) {
if (isPastDate(current, result.ref)) {
result.start.imply('month', result.start.impliedValues.month + 1);
}
}
if (result.start.isCertain('month') && !result.start.isCertain('year')) {
if (isPastDate(current, result.ref)) {
result.start.imply('year', result.start.impliedValues.year + 1);
}
}
});
return results;
};
const chronoFuture = new chrono.Chrono(chrono.options.casualOption());
chronoFuture.refiners.push(EnforceFutureDate);
const DateUtils = {
// Localized format: ddd, MMM D, YYYY h:mmA
DATE_FORMAT_LONG: 'llll',
DATE_FORMAT_LONG_NO_YEAR: moment.localeData().longDateFormat('llll').replace(yearRegex, ''),
// Localized format: MMM D, h:mmA
DATE_FORMAT_SHORT: moment.localeData().longDateFormat('lll').replace(yearRegex, ''),
DATE_FORMAT_llll_NO_TIME: moment.localeData().longDateFormat("llll").replace(/h:mm/, "").replace(" A", ""),
DATE_FORMAT_LLLL_NO_TIME: moment.localeData().longDateFormat("LLLL").replace(/h:mm/, "").replace(" A", ""),
if (result.start.isCertain('day') && !result.start.isCertain('month')) {
if (isPastDate(current, result.ref)) {
result.start.imply('month', result.start.impliedValues.month + 1);
}
}
if (result.start.isCertain('month') && !result.start.isCertain('year')) {
if (isPastDate(current, result.ref)) {
result.start.imply('year', result.start.impliedValues.year + 1);
}
}
});
return results;
};
const chronoBasic = new chrono.Chrono(chrono.options.casualOption());
const chronoFuture = new chrono.Chrono(chrono.options.casualOption());
chronoFuture.refiners.push(EnforceFutureDate);
const DateUtils = {
// Localized format: ddd, MMM D, YYYY h:mmA
DATE_FORMAT_LONG: 'llll',
// Localized format: MMM D, h:mmA
DATE_FORMAT_SHORT: moment.localeData().longDateFormat('lll').replace(yearRegex, ''),
format(momentDate, formatString) {
if (!momentDate) return null;
return momentDate.format(formatString);
},
if (result.start.isCertain('day') && !result.start.isCertain('month')) {
if (isPastDate(current, result.ref)) {
result.start.imply('month', result.start.impliedValues.month + 1);
}
}
if (result.start.isCertain('month') && !result.start.isCertain('year')) {
if (isPastDate(current, result.ref)) {
result.start.imply('year', result.start.impliedValues.year + 1);
}
}
});
return results;
};
const chronoBasic = new chrono.Chrono(chrono.options.casualOption());
const chronoFuture = new chrono.Chrono(chrono.options.casualOption());
chronoFuture.refiners.push(EnforceFutureDate);
const DateUtils = {
// Localized format: ddd, MMM D, YYYY h:mmA
DATE_FORMAT_LONG: 'llll',
// Localized format: MMM D, h:mmA
DATE_FORMAT_SHORT: moment.localeData().longDateFormat('lll').replace(yearRegex, ''),
format(momentDate, formatString) {
if (!momentDate) return null;
return momentDate.format(formatString);
},