Basic Information
Locale Info
A lot of other information about a locale is available via the LocaleInfo class:
var LocaleInfo = require("<path-to-ilib>/lib/LocaleInfo.js");var li = new LocaleInfo({locale: "ru-RU"});li.getScript()// Cyrlli.getClock()// 24li.getCurrency()// RUBli.getFirstDayOfWeek()// 1 (Monday)li.getMeridiemsStyle()// gregorianli.getPaperSize()// A4li.getTimeZone()// Europe/Moscowli.getUnits()// metric
Things that the locale information instance can tell you:
- Scripts used to write the language
- The first day of the week in calendars
- The default paper sizes
- The currency
- The default time zone
- The measurement units system ("metric", "uscustomary", or "imperial")
- The default calendar type (usually "gregorian")
- The default clock hours, 12 or 24
- The default rounding mode
- and more
Script Info
A information about a Script is available via the ScriptInfo class:
Thigs that the Script information instance can tell you:
- The 4-letter ISO 15924 identifier
- The ISO 15924 code number
- The name of this script in English
- The usual direction that text in this script is written in
- and more
var ScriptInfo = require("<path-to-ilib>/lib/ScriptInfo.js");var si = new ScriptInfo("Latn");si.getCode()// Latnsi.getCodeNumber()// 215si.getName()// Latinsi.getScriptDirection()// ltr
Currency Info
A information about a Currency is available via the Currency class: Thigs that the Currency information instance can tell you:
- The ISO 4217 currency code
- The locale for this currency
- The name of the currency in English
- The sign commonly used to represent this currency.
- and more
var Currency = require("<path-to-ilib>/lib/Currency.js");var cur = new Currency({code: "KRW"});cur.getName()// South Korean Woncur.getSign()// ₩
Timezone Info
A information about a Timezone is available via the TimeZone class:
var TimeZone = require("<path-to-ilib>/lib/TimeZone.js");var tz = new TimeZone({id: "America/Los_Angeles"});tz.getCountry()// UStz.getDisplayName()// PSTtz.getDSTSavings()// { h: 1 }
Thigs that the TimeZone information instance can tell you:
- The ISO 3166 code of the country for which this time zone is defined.
- The amount of time in hours:minutes that the clock is advanced during daylight savings time.
- The offset of this time zone from UTC at the given date/time.
- and more