Calendar

The various calendars supported by OmniGraffle, OmniFocus, and OmniOutliner. OmniPlan supports another version of the Calendar class.

Class Properties

Instance Properties

Properties of an instance of the Calendar class:

Calendar.current.locale

Instance Functions

The available functions for an instance of the Calendar class:

var now = new Date() today = Calendar.current.startOfDay(now)

DateComponents Class

The DateComponents class represents the elements that comprise a date, such as day, hour, year, and minute.

Constructors

Instance Properties

The properties of an instance of the DateComponents class:

var date = new Date() var dc = Calendar.current.dateComponentsFromDate(date) dc.month + "/" + dc.day + "/" + dc.year
dc = new DateComponents() dc.month = 12 dc.day = 31 dc.year = 2019 date = Calendar.current.dateFromDateComponents(dc)
startDate = new Date("8/1/2019") endDate = new Date("10/15/2019") result = Calendar.current.dateComponentsBetweenDates(startDate, endDate) result.month result.day
now = new Date() today = Calendar.current.startOfDay(now) duration = new DateComponents() duration.day = 45 duration.hour = 17 targetDate = Calendar.current.dateByAddingDateComponents(today,duration)

TimeZone Class

Objects that represent a time zone.

Class Properties

The properties of the TimeZone class:

TimeZone.abbreviations

Constructors

Instance Properties

The properties of an instance of the TimeZone class:

tzone = new TimeZone("PST") tzone.daylightSavingTime

Locale Class

Objects that represent a locale.

Class Properties

The properties of the Locale class:

Locale.identifiers

Constructors

Instance Properties

The properties of an instance of the Locale class:

loc = new Locale("en_US") loc.calendar
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER