@progress/kendo-date-math
Version:
Kendo UI typescript package exporting functions for Date manipulations
20 lines (19 loc) • 758 B
TypeScript
import { Day } from "./day.enum";
import { Direction } from "./direction.enum";
/**
* @hidden
*
* A function which returns the next or previous date for a specific week day. For example, `Day.Monday`.
*
* @param date - The date to calculate from.
* @param weekDay - The `Day` enum specifying the desired week day.
* @param direction - The `Direction` enum specifying the calculation direction.
* @returns - A `Date` instance.
*
* @example
* ```ts-no-run
* dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Forward); // 2016-01-06, Wednesday
* dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Backward); // 2015-12-30, Wednesday
* ```
*/
export declare const dayOfWeek: (date: Date, weekDay: Day, direction?: Direction) => Date;