getMonth.d.ts 671 B

123456789101112131415161718192021222324252627
  1. import type { ContextOptions, DateArg } from "./types.js";
  2. /**
  3. * The {@link getMonth} function options.
  4. */
  5. export interface GetMonthOptions extends ContextOptions<Date> {}
  6. /**
  7. * @name getMonth
  8. * @category Month Helpers
  9. * @summary Get the month of the given date.
  10. *
  11. * @description
  12. * Get the month of the given date.
  13. *
  14. * @param date - The given date
  15. * @param options - An object with options
  16. *
  17. * @returns The month index (0-11)
  18. *
  19. * @example
  20. * // Which month is 29 February 2012?
  21. * const result = getMonth(new Date(2012, 1, 29))
  22. * //=> 1
  23. */
  24. export declare function getMonth(
  25. date: DateArg<Date> & {},
  26. options?: GetMonthOptions | undefined,
  27. ): number;