withHour
Syntax
$calendar.withHour($hour)
Description
Creates a new calendar from the given calendar, setting the hour to hour
. Changing the calendar week can also change other values such as the time of day (a.m. or p.m.).
Parameter
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
calendar | Business object | The calendar whose hour is to be changed. It can be a system or user calendar. | yes | |
hour | Number | Value for the new hour to be set for the calendar. | yes |
Return value
Type: Business object
A calendar with the changed value for the hour.
Examples
dateTime(2012, 8, 15, 5, 55, 24, 45).toUserCalendar().withHour(22).hour()
Output: 22