withAmPmAdded

Syntax

	$calendar.withAmPmAdded($value)

Description

Creates a new calendar from the given calendar, adding value to the time of day. The addition of the value can affect other values, for example the hour.

Parameters

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
value Number Value by which amPm should be increased. yes

Return value

Type: Business object

A calendar with the changed value for the time of day.

Examples

	dateTime(2012, 8, 10, 19, 55, 24, 13).toUserCalendar().withAmPmAdded(1).amPm()

Output: 0

Since 19 hours is the afternoon, amPm is originally 1 (so p.m.).

Hour after adjustment

	dateTime(2012, 8, 10, 19, 55, 24, 13).toUserCalendar().withAmPmAdded(1).hour()

Output: 7

Adjusting amPm also changes other values such as the hour.