Intl.DateTimeFormat.prototype

The Intl.DateTimeFormat.prototype property represents the prototype object for the Intl.DateTimeFormat constructor.

Property attributes of Intl.DateTimeFormat.prototype
Writable no
Enumerable no
Configurable no

Description

See DateTimeFormat for a description of Intl.DateTimeFormat instances.

Intl.DateTimeFormat instances inherit from Intl.DateTimeFormat.prototype. Modifications to the prototype object are inherited by all Intl.DateTimeFormat instances.

Properties

Intl.DateTimeFormat.prototype.constructor
A reference to Intl.DateTimeFormat.

Methods

Intl.DateTimeFormat.prototype.format()
Getter function that formats a date according to the locale and formatting options of this DateTimeFormat object.
Intl.DateTimeFormat.prototype.formatToParts()
Returns an Array of objects representing the date string in parts that can be used for custom locale-aware formatting.
Intl.DateTimeFormat.prototype.resolvedOptions()
Returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
Intl.DateTimeFormat.prototype.formatRange()
This method receives two Dates and formats the date range in the most concise way based on the locale and options provided when instantiating DateTimeFormat.
Intl.DateTimeFormat.prototype.formatRangeToParts()
This method receives two Dates and returns an Array of objects containing the locale-specific tokens representing each part of the formatted date range.

Specifications

Specification Status Comment
ECMAScript Internationalization API 4.0 (ECMA-402)
The definition of 'Intl.DateTimeFormat.prototype' in that specification.
Draft
ECMAScript Internationalization API 2.0 (ECMA-402)
The definition of 'Intl.DateTimeFormat.prototype' in that specification.
Standard
ECMAScript Internationalization API 1.0 (ECMA-402)
The definition of 'Intl.DateTimeFormat.prototype' in that specification.
Standard Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
prototypeChrome Full support 24Edge Full support 12Firefox Full support 29IE Full support 11Opera Full support 15Safari Full support 10WebView Android No support NoChrome Android Full support 26Firefox Android Full support 56Opera Android ? Safari iOS Full support 10Samsung Internet Android Full support 1.5nodejs ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also