@progress/kendo-date-math
Version:
Kendo UI typescript package exporting functions for Date manipulations
18 lines (17 loc) • 564 B
JavaScript
import { Direction } from "./direction.enum";
import { dayOfWeek } from './day-of-week';
/**
* A function which returns a date by a specific week name. For example, `Day.Monday`.
*
* @param date - The date to calculate from.
* @param weekDay - The `Day` enum specifying the desired week day.
* @returns - A `Date` instance.
*
* @example
* ```ts-no-run
* nextDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2016-01-06, Wednesday
* ```
*/
export var nextDayOfWeek = function (date, weekDay) {
return dayOfWeek(date, weekDay, Direction.Forward);
};