withMonth
Syntax
$calendar.withMonth($month)
Description
Creates a new calendar from the given calendar, setting the month to month
. Changing the month can also change other values such as the calendar week .
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
calendar | Business object | The calendar whose month is to be changed. It can be a system or user calendar. | yes | |
month | Number | Value for the new month to be set for the calendar. | yes |
Return value
Type: Business object
A calendar with the changed value for the month.
Examples
date(2012, 8, 15).toUserCalendar().withMonth(3).month()
Output: 3