isSameQuarter.d.ts 1.1 KB

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