withAmPm
Syntax
$calendar.withAmPm($value)
Description
Creates a new calendar from the given calendar, setting the time of day (a.m. or p.m.) to amPm
. Changing the time of day can also change other values such as the hour.
Parameter
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
calendar | Business object | The calendar whose time of day is to be changed. It can be a system or user calendar. | yes | |
amPm | Number | Value for the morning a.m. (0) and the afternoon p.m. (1). | yes |
Return value
Type: Business object
A calendar with the modified value for the time of day.
Examples
Change amPm
dateTime(2012, 8, 10, 7, 55, 24, 13).toUserCalendar().withAmPm(1).amPm()
Output: 1
Adjusting the hour after amPm Adjustment
dateTime(2012, 8, 10, 7, 55, 24, 13).toUserCalendar().withAmPm(1).hour()
Output: 19
By changing to p.m., 7 now stands for 19 hours.