withHour12Added
Syntax
$calendar.withHour12Added($value)
Description
Creates a new calendar from the given calendar, increasing the hour by value
in 12-hour format. 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 hour is to be changed. It can be a system or user calendar. | yes | |
value | Number | Value to be added to the current hour of the calendar. | yes |
Return value
Type: Subject object
A calendar with the changed value for the hour.
Examples
hour <= 12
dateTime(2012, 8, 10, 7, 55, 24, 13).toUserCalendar().withHour12Added(2).hour12()
Output: 9
hour > 12
dateTime(2012, 8, 10, 7, 55, 24, 13).toUserCalendar().withHour12Added(6).hour12()
Output: 1