startOfToday.js 677 B

1234567891011121314151617181920212223242526272829303132
  1. import { startOfDay } from "./startOfDay.js";
  2. /**
  3. * The {@link startOfToday} function options.
  4. */
  5. /**
  6. * @name startOfToday
  7. * @category Day Helpers
  8. * @summary Return the start of today.
  9. * @pure false
  10. *
  11. * @description
  12. * Return the start of today.
  13. *
  14. * @typeParam ContextDate - The `Date` type of the context function.
  15. *
  16. * @param options - An object with options
  17. *
  18. * @returns The start of today
  19. *
  20. * @example
  21. * // If today is 6 October 2014:
  22. * const result = startOfToday()
  23. * //=> Mon Oct 6 2014 00:00:00
  24. */
  25. export function startOfToday(options) {
  26. return startOfDay(Date.now(), options);
  27. }
  28. // Fallback for modularized imports:
  29. export default startOfToday;