UNPKG

668 BTypeScriptView Raw
1/**
2 * @name getDay
3 * @category Weekday Helpers
4 * @summary Get the day of the week of the given date.
5 *
6 * @description
7 * Get the day of the week of the given date.
8 *
9 * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
10 *
11 * @param date - The given date
12 *
13 * @returns The day of week, 0 represents Sunday
14 *
15 * @example
16 * // Which day of the week is 29 February 2012?
17 * const result = getDay(new Date(2012, 1, 29))
18 * //=> 3
19 */
20export declare function getDay<DateType extends Date>(
21 date: DateType | number | string,
22): number;