withWeekOfMonthAdded
Syntax
$calendar.withWeekOfMonthAdded($value)
Description
Creates a new calendar from the given calendar, adding value
to the week of the month. The addition of the value can have an effect on other values, for example the day.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
calendar | Business object | The calendar whose week of the month is to be changed. It can be a system or user calendar. | yes | |
value | Number | Value by which the week of the month should be increased. | yes |
Return value
Type: Business Object
A calendar with the changed value for the week of the month.
Examples
WeekOfMonth after customization
dateTime(2012, 8, 15, 7, 55, 24, 13).toUserCalendar().withWeekOfMonthAdded(1).weekOfMonth()
Output: 3
Day after adjustment
dateTime(2012, 8, 15, 7, 55, 24, 13).toUserCalendar().withWeekOfMonthAdded(1).day()
Output: 22
Adjustment of weekOfMonth
also changes other values such as day.