isAfter.js 797 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isAfter;
  6. var _toDate = _interopRequireDefault(require("./toDate"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. function isAfter(date, options) {
  9. // For backwards compatibility:
  10. // isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
  11. var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString();
  12. var comparison = (0, _toDate.default)(comparisonDate);
  13. var original = (0, _toDate.default)(date);
  14. return !!(original && comparison && original > comparison);
  15. }
  16. module.exports = exports.default;
  17. module.exports.default = exports.default;