withDayOfWeek
Syntax
$calendar.withDayOfWeek($day)
Description
Creates a new calendar from the given calendar, setting the day of the week to day
. Changing the day of the week can also change other values such as the day.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
calendar | Business object | The calendar whose day of the week is to be changed. It can be a system or user calendar. | yes | |
day | Number | Value for the new day of the week to set for the calendar. | yes |
Return value
Type: Business object
A calendar with the changed value for the day of the week.
Examples
dateTime(2012, 8, 10, 7, 55, 24, 13).toUserCalendar().withDayOfWeek(1).dayOfWeek()
Output: 1