Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
datetimeformattimezone
Advanced tools
Surgically polyfills timezone support in Intl.DateTimeFormat API
Surgically polyfills timezone support in Intl.DateTimeFormat
API
![Build Status][] ![NPMRel][] [Build Status]: https://travis-ci.org/markandey/DateTimeFormatTimeZone.svg?branch=master [NPMRel]: https://img.shields.io/npm/v/datetimeformattimezone.svg
Some browsers do not support arbitrary time zone in Intl.DateTimeFormat API (becuase its optional to support timezones as per ECMA-402 standard).
This polyfill is to add this support.
new Intl.DateTimeFormat('en', {
timeZone: 'Asia/Calcutta',
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric'
}).format(new Date());
// 12/4/2016, 3:20 AM
new Intl.DateTimeFormat('en', {
timeZone: 'America/Los_Angeles',
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric'
}).format(new Date());
// 12/3/2016, 1:50 PM
npm i datetimeformattimezone
This pollyfill does not add support for printing timeZone name. This does not mean it breaks standard, Intl.DateTimeFormat
will still behave the same as it would have without this polyfill. Also most uses cases does not include printing timeZone name.
FAQs
Surgically polyfills timezone support in Intl.DateTimeFormat API
The npm package datetimeformattimezone receives a total of 6 weekly downloads. As such, datetimeformattimezone popularity was classified as not popular.
We found that datetimeformattimezone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.