UNPKG

635 BJavaScriptView Raw
1import { toDate } from "./toDate.js";
2
3/**
4 * The {@link isSaturday} function options.
5 */
6
7/**
8 * @name isSaturday
9 * @category Weekday Helpers
10 * @summary Is the given date Saturday?
11 *
12 * @description
13 * Is the given date Saturday?
14 *
15 * @param date - The date to check
16 * @param options - An object with options
17 *
18 * @returns The date is Saturday
19 *
20 * @example
21 * // Is 27 September 2014 Saturday?
22 * const result = isSaturday(new Date(2014, 8, 27))
23 * //=> true
24 */
25export function isSaturday(date, options) {
26 return toDate(date, options?.in).getDay() === 6;
27}
28
29// Fallback for modularized imports:
30export default isSaturday;