Wednesday, July 3, 2024
HomeLanguagesJavascriptJavaScript Intl Complete Reference

JavaScript Intl Complete Reference

Intl in JavaScript is an object which is used for ECMAScript Internationalization API namespace.

Intl.function()

Example 1: Below examples illustrate the IntlDateTimeFormatprototyperesolvedOptions() method in JavaScript:

Javascript




<script>
    const neveropen = new Intl.DateTimeFormat('zh-CN', { timeZone: 'UTC' });
    const result = neveropen.resolvedOptions();
    console.log(result.locale);
    console.log(result.calendar);
    console.log(result.timeZone);
      
    const neveropen1 = new Intl.DateTimeFormat('LT');
    const result1 = neveropen1.resolvedOptions();
    console.log(result1.locale);
    console.log(result1.calendar);
</script>


Output:

zh-CN
gregory
UTC
lt
gregory

JavaScript Intl Methods: The complete list of JavaScript Intl methods are listed below:

Method 

Description  Example 
resolvedOptions() The locale and collation options are computed during the initialization of this Collator object.
Try
supportedLocalesOf() It can be collated without resorting to the runtime’s default locale.
Try
getCanonicalLocales() Returns an array containing the canonical locale names.
Try
format() Returns a string with a language-specific representation of the list.
Try
resolvedOptions() The location and style formatting choices were made when the current IntlListFormat object was built.
Try
formatToParts() Format a list of values in a locale-aware fashion.
Try
supportedLocalesOf() The provided locales are supported in list formatting.
Try
supportedLocalesOf() The provided locales are supported in date and time formatting.
Try
resolvedOptions()  The locale, date, and time formatting options are computed during the initialization of this DateTimeFormat object.
Try
formatRangeToParts() The formatted date range is produced by DateTimeFormat formatters.
Try
format() The locale and formatting options of this IntlDateTimeFormat object.
Try
formatRange() The locale and options provided when instantiating IntlDateTimeFormat object.
Try
formatToParts() Allows locale-aware formatting of strings produced by DateTimeFormat formatters.
Try

Shaida Kate Naidoo
am passionate about learning the latest technologies available to developers in either a Front End or Back End capacity. I enjoy creating applications that are well designed and responsive, in addition to being user friendly. I thrive in fast paced environments. With a diverse educational and work experience background, I excel at collaborating with teams both local and international. A versatile developer with interests in Software Development and Software Engineering. I consider myself to be adaptable and a self motivated learner. I am interested in new programming technologies, and continuous self improvement.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments