/* eslint-disable eslint-comments/no-unlimited-disable */ /* eslint-disable */ // @ts-nocheck import { toDate } from '../toDate/index.ts'; import type { ContextOptions, DateArg } from '../types.ts'; /** * The {@link isWeekend} function options. */ export interface IsWeekendOptions extends ContextOptions {} /** * @name isWeekend * @category Weekday Helpers * @summary Does the given date fall on a weekend? * * @description * Does the given date fall on a weekend? A weekend is either Saturday (`6`) or Sunday (`0`). * * @param date - The date to check * @param options - An object with options * * @returns The date falls on a weekend * * @example * // Does 5 October 2014 fall on a weekend? * const result = isWeekend(new Date(2014, 9, 5)) * //=> true */ export function isWeekend(date: DateArg & {}, options?: IsWeekendOptions | undefined): boolean { const day = toDate(date, options?.in).getDay(); return day === 0 || day === 6; } /* eslint-enable */