Skip to content
Related Articles

Related Articles

JavaScript Intl Complete Reference

Improve Article
Save Article
  • Last Updated : 21 Nov, 2022
Improve Article
Save Article

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

Intl.function()

Example 1: Below examples illustrate the Intl.DateTimeFormat.prototype.resolvedOptions() method in JavaScript:

Javascript




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

Output:

zh-CN
gregory
UTC
lt
gregory

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

JavaScript Intl Method 

Description 
JavaScript Intl.Collator.prototype.resolvedOptions() Method

This is used to return a new object with properties reflecting the locale and collation options computed during the 

initialization of this Collator object.

JavaScript Intl.Collator.supportedLocalesOf() MethodThis is used to return an array containing those of the provided locales that are supported in collation without having to fall back to the runtime‚Äôs default locale. 
JavaScript Intl.getCanonicalLocales() MethodIn JavaScript is a Standard built-in object which returns an array containing the canonical locale names.
JavaScript Intl.ListFormat.prototype.format() MethodIn JavaScript which returns a string with a language-specific representation of the list.
JavaScript Intl.ListFormat.prototype.resolvedOptions() MethodIn JavaScript which returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current ListFormat object.
JavaScript Intl.ListFormat.prototype.formatToParts() MethodIn JavaScript which returns an Array of objects representing the different components that can be used to format a list of values in a locale-aware fashion.
JavaScript Intl.ListFormat.supportedLocalesOf() MethodIn JavaScript, it returns an array containing those of the provided locales that are supported in date and time formatting.
JavaScript Intl.DateTimeFormat.supportedLocalesOf() MethodThis method is an inbuilt method in JavaScript that returns an array containing those of the provided locales that are supported in date and time formatting.
JavaScript Intl.DateTimeFormat.prototype.resolvedOptions() MethodIn JavaScript which returns a new object with properties reflecting the locale, date, and time formatting options computed during the initialization of this DateTimeFormat object.
JavaScript Intl.DateTimeFormat.prototype.formatRangeToParts() MethodIn JavaScript which is used to allow locale-specific tokens representing each part of the formatted date range produced by DateTimeFormat formatters.
JavaScript Intl.DateTimeFormat.prototype.format() MethodIn JavaScript which is used to format a date according to the locale and formatting options of this Intl.DateTimeFormat object.
JavaScript Intl.DateTimeFormat.prototype.formatRange() Method In JavaScript which is used to format a date range in the most concise way based on the locale and options provided when instantiating Intl.DateTimeFormat object.
JavaScript Intl.DateTimeFormat.prototype.formatToParts() MethodIn JavaScript which allows locale-aware formatting of strings produced by DateTimeFormat formatters.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!