endOfToday.js 640 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. exports.endOfToday = endOfToday;
  3. var _index = require("./endOfDay.js");
  4. /**
  5. * @name endOfToday
  6. * @category Day Helpers
  7. * @summary Return the end of today.
  8. * @pure false
  9. *
  10. * @description
  11. * Return the end of today.
  12. *
  13. * @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).
  14. *
  15. * @returns The end of today
  16. *
  17. * @example
  18. * // If today is 6 October 2014:
  19. * const result = endOfToday()
  20. * //=> Mon Oct 6 2014 23:59:59.999
  21. */
  22. function endOfToday() {
  23. return (0, _index.endOfDay)(Date.now());
  24. }