Built-In Namespace _global_
Field Attributes | Field Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
CalendarFactory(options)
Factory method to create a new instance of a calendar subclass.
|
<static> |
DateFactory(options)
Factory method to create a new instance of a date subclass.
|
<static> |
isAlnum(ch)
Return whether or not the first character is alphabetic or numeric.
|
<static> |
isAlpha(ch)
Return whether or not the first character is alphabetic.
|
<static> |
isAscii(ch)
Return whether or not the first character is in the ASCII range.
|
<static> |
isBlank(ch)
Return whether or not the first character is a blank character.
|
<static> |
isCntrl(ch)
Return whether or not the first character is a control character.
|
<static> |
isDigit(ch)
Return whether or not the first character is a digit character in the
Latin script.
|
<static> |
isGraph(ch)
Return whether or not the first character is any printable character
other than space.
|
<static> |
isIdeo(ch)
Return whether or not the first character is an ideographic character.
|
<static> |
isLower(ch)
Return whether or not the first character is lower-case.
|
<static> |
isPrint(ch)
Return whether or not the first character is any printable character,
including space.
|
<static> |
isPunct(ch)
Return whether or not the first character is punctuation.
|
<static> |
isScript(ch, script)
Return whether or not the first character in the given string is
in the given script.
|
<static> |
isSpace(ch)
Return whether or not the first character is a whitespace character.
|
<static> |
isUpper(ch)
Return whether or not the first character is upper-case.
|
<static> |
isXdigit(ch)
Return whether or not the first character is a hexadecimal digit written
in the Latin script.
|
<static> |
MeasurementFactory(options)
Create a measurement subclass instance based on a particular measure
required.
|
<static> |
PhoneHandlerFactory(locale, plan)
Creates a phone handler instance that is correct for the locale.
|
Defined in: ilib-full-dyn.js.
Defined in: ilib-full-dyn.js.
The options parameter can be an object that contains the following properties:
- type - specify the type of the calendar desired. The list of valid values changes depending on which calendars are defined. When assembling your iliball.js, include those calendars you wish to use in your program or web page, and they will register themselves with this factory method. The "official", "gregorian", and "julian" calendars are all included by default, as they are the standard calendars for much of the world.
- locale - some calendars vary depending on the locale. For example, the "official" calendar transitions from a Julian-style calendar to a Gregorian-style calendar on a different date for each country, as the governments of those countries decided to adopt the Gregorian calendar at different times.
- onLoad - a callback function to call when the calendar object is fully loaded. When the onLoad option is given, the calendar factory will attempt to load any missing locale data using the ilib loader callback. When the constructor is done (even if the data is already preassembled), the onLoad function is called with the current instance as a parameter, so this callback can be used with preassembled or dynamic loading or a mix of the two.
- sync - tell whether to load any missing locale data synchronously or asynchronously. If this option is given as "false", then the "onLoad" callback must be given, as the instance returned from this constructor will not be usable for a while.
- loadParams - an object containing parameters to pass to the loader callback function when locale data is missing. The parameters are not interpretted or modified in any way. They are simply passed along. The object may contain any property/value pairs as long as the calling code is in agreement with the loader callback function as to what those parameters mean.
Defined in: ilib-full-dyn.js.
- Parameters:
- {Object=} options
- options controlling the construction of this instance, or undefined to use the default options
- Returns:
- {Calendar} an instance of a calendar object of the appropriate type
The options parameter can be an object that contains the following properties:
- type - specify the type/calendar of the date desired. The list of valid values changes depending on which calendars are defined. When assembling your iliball.js, include those date type you wish to use in your program or web page, and they will register themselves with this factory method. The "gregorian", and "julian" calendars are all included by default, as they are the standard calendars for much of the world. If not specified, the type of the date returned is the one that is appropriate for the locale. This property may also be given as "calendar" instead of "type".
- onLoad - a callback function to call when the date object is fully loaded. When the onLoad option is given, the date factory will attempt to load any missing locale data using the ilib loader callback. When the constructor is done (even if the data is already preassembled), the onLoad function is called with the current instance as a parameter, so this callback can be used with preassembled or dynamic loading or a mix of the two.
- sync - tell whether to load any missing locale data synchronously or asynchronously. If this option is given as "false", then the "onLoad" callback must be given, as the instance returned from this constructor will not be usable for a while.
- loadParams - an object containing parameters to pass to the loader callback function when locale data is missing. The parameters are not interpretted or modified in any way. They are simply passed along. The object may contain any property/value pairs as long as the calling code is in agreement with the loader callback function as to what those parameters mean.
Please note that if you do not give the type parameter, this factory method will create a date object that is appropriate for the calendar that is most commonly used in the specified or current ilib locale. For example, in Thailand, the most common calendar is the Thai solar calendar. If the current locale is "th-TH" (Thai for Thailand) and you use this factory method to construct a new date without specifying the type, it will automatically give you back an instance of ThaiSolarDate. This is convenient because you do not need to know which locales use which types of dates. In fact, you should always use this factory method to make new date instances unless you know that you specifically need a date in a particular calendar.
Also note that when you pass in the date components such as year, month,
day, etc., these components should be appropriate for the given date
being instantiated. That is, in our Thai example in the previous
paragraph, the year and such should be given as a Thai solar year, not
the Gregorian year that you get from the Javascript Date class. In
order to initialize a date instance when you don't know what subclass
will be instantiated for the locale, use a parameter such as "unixtime"
or "julianday" which are unambiguous and based on UTC time, instead of
the year/month/date date components. The date components for that UTC
time will be calculated and the time zone offset will be automatically
factored in.
Defined in: ilib-full-dyn.js.
- Parameters:
- {Object=} options
- options controlling the construction of this instance, or undefined to use the default options
- Returns:
- {IDate} an instance of a calendar object of the appropriate type
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is alphabetic or numeric
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is alphabetic.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is in the ASCII range.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is a blank character.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is a control character.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is a digit character in the Latin script.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is any printable character other than space.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is an ideographic character.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is lower-case.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is printable.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is punctuation.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- {string} script
- the 4-letter ISO 15924 to query against
- Returns:
- {boolean} true if the first character is in the given script, and false otherwise
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is a whitespace character.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is upper-case.
Defined in: ilib-full-dyn.js.
- Parameters:
- {string|IString|number} ch
- character or code point to examine
- Returns:
- {boolean} true if the first character is a hexadecimal digit written in the Latin script.
The options may contain any of the following properties:
- amount - either a numeric amount for this measurement given as a number of the specified units, or another Measurement instance to convert to the requested units. If converting to new units, the type of measure between the other instance's units and the current units must be the same. That is, you can only convert one unit of mass to another. You cannot convert a unit of mass into a unit of length.
- unit - units of this measurement. Use the static call MeasurementFactory.getAvailableUnits to find out what units this version of ilib supports. If the given unit is not a base unit, the amount will be normalized to the number of base units and stored as that number of base units. For example, if an instance is constructed with 1 kg, this will be converted automatically into 1000 g, as grams are the base unit and kg is merely a commonly used scale of grams.
var measurement1 = MeasurementFactory({ amount: 5, units: "kilometers" }); var measurement2 = MeasurementFactory({ amount: measurement1, units: "miles" });The value in measurement2 will end up being about 3.125 miles.
The second method uses the convert method.
var measurement1 = MeasurementFactory({ amount: 5, units: "kilometers" }); var measurement2 = measurement1.convert("miles"); });The value in measurement2 will again end up being about 3.125 miles.
Defined in: ilib-full-dyn.js.
- Parameters:
- {Object=} options
- options that control the construction of this instance
Defined in: ilib-full-dyn.js.
- Parameters:
- locale
- plan
- Returns:
- {PhoneHandler} the correct phone handler for the locale