endOfToday.js 910 B

123456789101112131415161718192021222324252627282930313233
  1. import { endOfDay } from "./endOfDay.js";
  2. /**
  3. * The {@link endOfToday} function options.
  4. */
  5. /**
  6. * @name endOfToday
  7. * @category Day Helpers
  8. * @summary Return the end of today.
  9. * @pure false
  10. *
  11. * @description
  12. * Return the end of today.
  13. *
  14. * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
  15. * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
  16. *
  17. * @param options - The options
  18. *
  19. * @returns The end of today
  20. *
  21. * @example
  22. * // If today is 6 October 2014:
  23. * const result = endOfToday()
  24. * //=> Mon Oct 6 2014 23:59:59.999
  25. */
  26. export function endOfToday(options) {
  27. return endOfDay(Date.now(), options);
  28. }
  29. // Fallback for modularized imports:
  30. export default endOfToday;