dayOfWeek
Returns a new date object that is set with a particular day of the week.
Parameters
targetDate Date
The date to set the day of the week to.
dayOfWeek Number
The day of the week to be set.
direction Number
The direction that determines the day of the week to be set.
One (1
) indicates the day after the current one (default value). Minus one (-1
) indicates the day before the current one.
Returns
Date
A new date object that is set with a particular day of the week.
Example
<script>
var targetDate = new Date(2016,10,5,15,25,11);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(kendo.date.dayOfWeek(targetDate, 1, 1)); // Mon Nov 07 2016 15:25:11 GMT+0200 (FLE Standard Time)
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(kendo.date.dayOfWeek(targetDate, 1, -1)); // Mon Oct 31 2016 15:25:11 GMT+0200 (FLE Standard Time)
</script>