withWeekAdded
Syntax
$calendar.withWeekAdded($value)
Description
Creates a new calendar from the given calendar, adding value
to the calendar week. 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 calendar week is to be changed. It can be a system or user calendar. | yes | |
value | Number | Value by which the calendar week should be increased. | yes |
Return value
Type: Business object
A calendar with the changed value for the calendar week.
Examples
Week number after adjustment
dateTime(2012, 8, 15, 7, 55, 24, 13).toUserCalendar().withWeekAdded(5).week()
Output: 42
Day after adjustment
dateTime(2012, 8, 15, 7, 55, 24, 13).toUserCalendar().withWeekAdded(5).day()
Output: 20
Adjusting week
also changes other values such as day.