nextMonday.cjs 958 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. exports.nextMonday = nextMonday;
  3. var _index = require("./nextDay.cjs");
  4. /**
  5. * The {@link nextMonday} function options.
  6. */
  7. /**
  8. * @name nextMonday
  9. * @category Weekday Helpers
  10. * @summary When is the next Monday?
  11. *
  12. * @description
  13. * When is the next Monday?
  14. *
  15. * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
  16. * @typeParam ResultDate - The result `Date` type, returned from the context function if passed, or inferred from the arguments.
  17. *
  18. * @param date - The date to start counting from
  19. * @param options - An object with options
  20. *
  21. * @returns The next Monday
  22. *
  23. * @example
  24. * // When is the next Monday after Mar, 22, 2020?
  25. * const result = nextMonday(new Date(2020, 2, 22))
  26. * //=> Mon Mar 23 2020 00:00:00
  27. */
  28. function nextMonday(date, options) {
  29. return (0, _index.nextDay)(date, 1, options);
  30. }