Methods
-
(static) dateToLocalIso(date) → {string}
-
Returns a local isoString provided a Date object
Parameters:
Name Type Description dateDate - Since:
- 0.7
Returns:
isoString- Type
- string
-
(static) getConverterInstance(converterOption) → {Object|null}
-
Given either an Object literal representing a 'converter' option (used in components) or a converter instance of type oj.Converter, this method returns the converter instance. You can also pass in a string. In this case, it will return you an instance of a converter registered with that type.
Parameters:
Name Type Description converterOptionstring | Object - Since:
- 0.6
Returns:
converterInstance or null if a converter cannot be determined- Type
- Object | null
-
(static) getInitials(firstName, lastName) → {string|undefined}
-
Returns a person's initials
Parameters:
Name Type Argument Description firstNamestring <optional>
first name lastNamestring <optional>
last name - Since:
- 4.0.0
Returns:
uppercase concatenation of first letter of first name and first letter of last name. There are the following special cases: - If the name is Arabic characters, it returns empty string. - If the name is Hindi characters, it returns the first letter of the first name. - If the name is Thai characters, it returns the first letter of the first name. - If the name is Korean characters, it returns the first name. - If the name is Japanese or Chinese characters, it returns the last name.- Type
- string | undefined
-
(static) getLocalTimeZoneOffset() → {string}
-
Returns the timezone offset between UTC and the local time in Etc/GMT[+-]hh:mm syntax. The offset is positive if the local timezone is behind UTC and negative if it is ahead. The offset range is between Etc/GMT-14 and Etc/GMT+12 (UTC-12 and UTC+14)
Returns:
- Type
- string
Examples
The local time is UTC-7 (Pacific Daylight Time)
oj.IntlConverterUtils.getLocalTimeZoneOffset() will return the string "Etc/GMT+07:00"The local time is UTC+1 (Central European Standard Time)
oj.IntlConverterUtils.getLocalTimeZoneOffset() will return the string "Etc/GMT-01:00" -
(static) isoToDate(isoString) → {Date}
-
Parses the isoString and returns a JavaScript Date object
Parameters:
Name Type Description isoStringstring isoString to parse and to return Date of Returns:
the parsed JavaScript Date Object- Type
- Date
-
(static) isoToLocalDate(isoString) → {Date}
-
Returns a local Date object provided a local isoString
Parameters:
Name Type Description isoStringstring date in isoString format - Since:
- 0.7
Returns:
localDate- Type
- Date