index.js 600 B

1234567891011121314151617181920212223
  1. import startOfDay from "../startOfDay/index.js";
  2. /**
  3. * @name startOfToday
  4. * @category Day Helpers
  5. * @summary Return the start of today.
  6. * @pure false
  7. *
  8. * @description
  9. * Return the start 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 start of today
  15. *
  16. * @example
  17. * // If today is 6 October 2014:
  18. * const result = startOfToday()
  19. * //=> Mon Oct 6 2014 00:00:00
  20. */
  21. export default function startOfToday() {
  22. return startOfDay(Date.now());
  23. }