isSameISOWeek.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import type { ContextOptions, DateArg } from "./types.js";
  2. /**
  3. * The {@link isSameISOWeek} function options.
  4. */
  5. export interface IsSameISOWeekOptions extends ContextOptions<Date> {}
  6. /**
  7. * @name isSameISOWeek
  8. * @category ISO Week Helpers
  9. * @summary Are the given dates in the same ISO week (and year)?
  10. *
  11. * @description
  12. * Are the given dates in the same ISO week (and year)?
  13. *
  14. * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
  15. *
  16. * @param laterDate - The first date to check
  17. * @param earlierDate - The second date to check
  18. * @param options - An object with options
  19. *
  20. * @returns The dates are in the same ISO week (and year)
  21. *
  22. * @example
  23. * // Are 1 September 2014 and 7 September 2014 in the same ISO week?
  24. * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7))
  25. * //=> true
  26. *
  27. * @example
  28. * // Are 1 September 2014 and 1 September 2015 in the same ISO week?
  29. * const result = isSameISOWeek(new Date(2014, 8, 1), new Date(2015, 8, 1))
  30. * //=> false
  31. */
  32. export declare function isSameISOWeek(
  33. laterDate: DateArg<Date> & {},
  34. earlierDate: DateArg<Date> & {},
  35. options?: IsSameISOWeekOptions | undefined,
  36. ): boolean;