startOfToday.mjs 489 B

123456789101112131415161718192021222324
  1. import { startOfDay } from "./startOfDay.mjs";
  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. * @returns The start of today
  12. *
  13. * @example
  14. * // If today is 6 October 2014:
  15. * const result = startOfToday()
  16. * //=> Mon Oct 6 2014 00:00:00
  17. */
  18. export function startOfToday() {
  19. return startOfDay(Date.now());
  20. }
  21. // Fallback for modularized imports:
  22. export default startOfToday;