index.js 763 B

12345678910111213141516171819202122232425262728
  1. import endOfDay from "../endOfDay/index.js";
  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. * > ⚠️ Please note that this function is not present in the FP submodule as
  12. * > it uses `Date.now()` internally hence impure and can't be safely curried.
  13. *
  14. * ### v2.0.0 breaking changes:
  15. *
  16. * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
  17. *
  18. * @returns {Date} the end of today
  19. *
  20. * @example
  21. * // If today is 6 October 2014:
  22. * var result = endOfToday()
  23. * //=> Mon Oct 6 2014 23:59:59.999
  24. */
  25. export default function endOfToday() {
  26. return endOfDay(Date.now());
  27. }