You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

date-fns-tz

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.9 to 1.0.10

23

_lib/tzTokenizeDate/index.js

@@ -56,4 +56,16 @@ "use strict";

if (!dtfCache[timeZone]) {
dtfCache[timeZone] = new Intl.DateTimeFormat('en-US', {
// New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12`
var testDateFormatted = new Intl.DateTimeFormat('en-US', {
hour12: false,
timeZone: 'America/New_York',
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
}).format(new Date('2014-06-25T04:00:00.123Z'));
var hourCycleSupported = testDateFormatted === '06/25/2014, 00:00:00' || testDateFormatted === '‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00';
dtfCache[timeZone] = hourCycleSupported ? new Intl.DateTimeFormat('en-US', {
hour12: false,
timeZone: timeZone,

@@ -66,2 +78,11 @@ year: 'numeric',

second: '2-digit'
}) : new Intl.DateTimeFormat('en-US', {
hourCycle: 'h23',
timeZone: timeZone,
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
});

@@ -68,0 +89,0 @@ }

@@ -46,5 +46,6 @@ /**

if (!dtfCache[timeZone]) {
dtfCache[timeZone] = new Intl.DateTimeFormat('en-US', {
// New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12`
var testDateFormatted = new Intl.DateTimeFormat('en-US', {
hour12: false,
timeZone: timeZone,
timeZone: 'America/New_York',
year: 'numeric',

@@ -56,5 +57,30 @@ month: '2-digit',

second: '2-digit'
})
}).format(new Date('2014-06-25T04:00:00.123Z'))
var hourCycleSupported =
testDateFormatted === '06/25/2014, 00:00:00' ||
testDateFormatted === '‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00'
dtfCache[timeZone] = hourCycleSupported
? new Intl.DateTimeFormat('en-US', {
hour12: false,
timeZone: timeZone,
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
})
: new Intl.DateTimeFormat('en-US', {
hourCycle: 'h23',
timeZone: timeZone,
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
})
}
return dtfCache[timeZone]
}

2

package.json
{
"name": "date-fns-tz",
"version": "1.0.9",
"version": "1.0.10",
"sideEffects": false,

@@ -5,0 +5,0 @@ "description": "Time zone support for date-fns v2 with the browser Intl API",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc