endOfToday.mjs 657 B

1234567891011121314151617181920212223242526
  1. import { endOfDay } from "./endOfDay.mjs";
  2. /**
  3. * @name endOfToday
  4. * @category Day Helpers
  5. * @summary Return the end of today.
  6. * @pure false
  7. *
  8. * @description
  9. * Return the end of today.
  10. *
  11. * @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).
  12. *
  13. * @returns The end of today
  14. *
  15. * @example
  16. * // If today is 6 October 2014:
  17. * const result = endOfToday()
  18. * //=> Mon Oct 6 2014 23:59:59.999
  19. */
  20. export function endOfToday() {
  21. return endOfDay(Date.now());
  22. }
  23. // Fallback for modularized imports:
  24. export default endOfToday;