getWeekOfMonth.d.cts 817 B

1234567891011121314151617181920212223242526272829303132333435
  1. import type {
  2. ContextOptions,
  3. DateArg,
  4. LocalizedOptions,
  5. WeekOptions,
  6. } from "./types.js";
  7. /**
  8. * The {@link getWeekOfMonth} function options.
  9. */
  10. export interface GetWeekOfMonthOptions
  11. extends LocalizedOptions<"options">,
  12. WeekOptions,
  13. ContextOptions<Date> {}
  14. /**
  15. * @name getWeekOfMonth
  16. * @category Week Helpers
  17. * @summary Get the week of the month of the given date.
  18. *
  19. * @description
  20. * Get the week of the month of the given date.
  21. *
  22. * @param date - The given date
  23. * @param options - An object with options.
  24. *
  25. * @returns The week of month
  26. *
  27. * @example
  28. * // Which week of the month is 9 November 2017?
  29. * const result = getWeekOfMonth(new Date(2017, 10, 9))
  30. * //=> 2
  31. */
  32. export declare function getWeekOfMonth(
  33. date: DateArg<Date> & {},
  34. options?: GetWeekOfMonthOptions,
  35. ): number;