withWeekOfMonth

Syntax

	$calendar.withWeekOfMonth($week)

Description

Creates a new calendar from the given calendar, setting the week of the month to week. Changing the week can also change other values such as 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
week Number Value for the new week of the month to be set for the calendar. yes

Return value

Type: Business object

A calendar with the changed value for the week of the month.

Examples

	dateTime(2012, 8, 10, 7, 55, 24, 13).toUserCalendar().withWeekOfMonth(15).weekOfMonth()

Output: 15