isTomorrow.cjs 830 B

123456789101112131415161718192021222324252627282930313233343536
  1. "use strict";
  2. exports.isTomorrow = isTomorrow;
  3. var _index = require("./addDays.cjs");
  4. var _index2 = require("./constructNow.cjs");
  5. var _index3 = require("./isSameDay.cjs");
  6. /**
  7. * The {@link isTomorrow} function options.
  8. */
  9. /**
  10. * @name isTomorrow
  11. * @category Day Helpers
  12. * @summary Is the given date tomorrow?
  13. * @pure false
  14. *
  15. * @description
  16. * Is the given date tomorrow?
  17. *
  18. * @param date - The date to check
  19. * @param options - An object with options
  20. *
  21. * @returns The date is tomorrow
  22. *
  23. * @example
  24. * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?
  25. * const result = isTomorrow(new Date(2014, 9, 7, 14, 0))
  26. * //=> true
  27. */
  28. function isTomorrow(date, options) {
  29. return (0, _index3.isSameDay)(
  30. date,
  31. (0, _index.addDays)((0, _index2.constructNow)(options?.in || date), 1),
  32. options,
  33. );
  34. }