index.js 586 B

1234567891011121314151617181920212223
  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. * @returns {Date} the end of today
  15. *
  16. * @example
  17. * // If today is 6 October 2014:
  18. * const result = endOfToday()
  19. * //=> Mon Oct 6 2014 23:59:59.999
  20. */
  21. export default function endOfToday() {
  22. return endOfDay(Date.now());
  23. }