withDayOfWeekInMonth
Syntax
$calendar.withDayOfWeekInMonth($day)
Description
Creates a new calendar from the given calendar, setting the day of the week in the month to day
. Changing the day of the week in the month 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 in the month is to be changed. It can be a system or user calendar. | yes | |
day | number | Value for the new day of the week in the month to be set for the calendar. | yes |
Return value
Type: Business object
A calendar with the changed value for the day of the week in the month.
Examples
dateTime(2012, 8, 10, 7, 55, 24, 13).toUserCalendar().withDayOfWeekInMonth(1).dayOfWeekInMonth()
Output: 1