isAfter.js 773 B

12345678910
  1. function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
  2. import toDate from './toDate';
  3. export default function isAfter(date, options) {
  4. // For backwards compatibility:
  5. // isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
  6. var comparisonDate = (_typeof(options) === 'object' ? options.comparisonDate : options) || Date().toString();
  7. var comparison = toDate(comparisonDate);
  8. var original = toDate(date);
  9. return !!(original && comparison && original > comparison);
  10. }