withEra
Syntax
$calendar.withEra($era)
Description
Creates a new calendar from the given calendar, setting the epoch to era
. Changing the day can also change other values such as the result of toMillis.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
calendar | Business object | The calendar whose epoch is to be changed. It can be a system or user calendar. | yes | |
era | Number | Value for the new epoch to be set for the calendar. | yes |
Return value
Type: Business object
A calendar with the changed value for the epoch.
Examples
date(2021, 9, 12).toSystemCalendar().withEra(0).era()
Output: 0