AuraLocalizationService
AuraLocalizationService provides methods for formatting and localizing dates. Use $A.localizationService to use the methods in AuraLocalizationService.
-
Converts a datetime from UTC to a specified timezone.
-
Converts a datetime from a specified timezone to UTC.
-
Displays a length of time.
-
Displays a length of time in days.
-
Displays a length of time in hours.
-
displayDurationInMilliseconds()
Displays a length of time in milliseconds.
-
Displays a length of time in minutes.
-
Displays a length of time in months.
-
Displays a length of time in seconds.
-
Returns an object representing a length of time.
-
Returns a date that is the end of a unit of time for the given date.
-
Returns a currency number based on the default currency format.
-
Returns a formatted date.
-
Returns a formatted date time.
-
Returns a formatted date time in UTC.
-
Returns a formatted date in UTC.
-
Returns a formatted number with the default number format.
-
Returns a formatted percentage number based on the default percentage format.
-
Returns a formatted time.
-
Returns a formatted time in UTC.
-
Gets a date string based on a time zone.
-
Returns the number of days in a duration.
-
Returns the default currency format.
-
Returns the default
NumberFormatobject. -
Returns the default percentage format.
-
Returns a length of time in hours.
-
Deprecated. Do not use. Returns date time labels, such as month name, weekday name.
-
Returns the number of milliseconds in a duration.
-
Returns the number of minutes in a duration.
-
Returns the number of months in a duration.
-
Returns a
NumberFormatobject. -
Returns the number of seconds in a duration.
-
Gets today’s date based on a time zone.
-
Returns the number of years in a duration.
-
Checks if
date1is afterdate2. -
Checks if
date1is beforedate2. -
Checks if
dateis betweenfromDateandtoDate, where the match is inclusive. -
Deprecated. Do not use. Checks if a datetime pattern string uses a 24-hour or 12-hour time view.
-
Checks if
date1is the same asdate2. -
Parses a string and returns a JavaScript Date.
-
Parses a date time string in an ISO-8601 format and returns a JavaScript Date.
-
Parses a string and returns a JavaScript Date.
-
Returns a date that is the start of a unit of time for the given date.
-
Deprecated. Use
Date.toISOString()instead. -
translateFromLocalizedDigits()
Translate the localized digit string to a string with Arabic digits, if there is any.
-
Translates the input date from another calendar system (for example, the Buddhist calendar) to the Gregorian calendar based on the locale.
-
Translate the input string to a string with localized digits, if there is any.
-
Translates the input date to a date in another calendar system (for example, the Buddhist calendar) based on the locale.
See Also