getDay.d.ts 694 B

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