Globalization

Improve this doc

$ ionic plugin add cordova-plugin-globalization

Repo: https://github.com/apache/cordova-plugin-globalization

Usage

import {Globalization} from 'ionic-native';

Static Methods

getPreferredLanguage()

Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.

Returns: Promise<{value:string}>

getLocaleName()

Returns the BCP 47 compliant locale identifier string to the successCallback with a properties object as a parameter.

Returns: Promise<{value:string}>

dateToString(date, options)

Converts date to string

Param Type Details
date
options

Returns: Promise<{value:string}>

stringToDate(dateString, options)

Param Type Details
dateString
options

getDatePattern(options)

Param Type Details
options

getDateNames(options)

Param Type Details
options

isDayLightSavingsTime(date)

Check if day light saving is active

Param Type Details
date

getFirstDayOfWeek()

Get first day of week

numberToString(options)

Param Type Details
options

stringToNumber(string, options)

Param Type Details
string
options

getNumberPattern(options)

Param Type Details
options

getCurrencyPattern(currencyCode)

Param Type Details
currencyCode

API

Native

General