isAfter.js 473 B

123456789
  1. import toDate from './toDate';
  2. export default function isAfter(date, options) {
  3. // For backwards compatibility:
  4. // isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
  5. var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString();
  6. var comparison = toDate(comparisonDate);
  7. var original = toDate(date);
  8. return !!(original && comparison && original > comparison);
  9. }