@technobuddha/library
Version:
A large library of useful functions
19 lines (18 loc) • 617 B
TypeScript
import type { DayOfWeek } from '../constants';
declare type Options = {
/** Use the UTC timezone */
UTC?: boolean;
/** Which day of the week is considered the beginning */
firstDayOfWeek?: DayOfWeek;
};
/**
* Determine the start of the week for a date
*
* @param input The date
* @param __namedParameters see {@link Options}
* @default UTC false
* @default firstDayOfWeek Sunday
* @returns The date value for midnight on the first day of the specified week
*/
export declare function getBeginningOfWeek(input: Date, { UTC, firstDayOfWeek }?: Options): Date;
export default getBeginningOfWeek;