diff --git a/package-lock.json b/package-lock.json index 323a78bed2f0..1f5041842ed2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,8 +46,8 @@ "babel-polyfill": "^6.26.0", "canvas-size": "^1.2.6", "core-js": "^3.32.0", - "date-fns": "^2.30.0", - "date-fns-tz": "^2.0.0", + "date-fns": "^4.1.0", + "date-fns-tz": "^3.2.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", "expensify-common": "2.0.94", @@ -20319,6 +20319,22 @@ "dev": true, "license": "MIT" }, + "node_modules/concurrently/node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/concurrently/node_modules/has-flag": { "version": "4.0.0", "dev": true, @@ -21280,24 +21296,20 @@ } }, "node_modules/date-fns": { - "version": "2.30.0", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", + "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" } }, "node_modules/date-fns-tz": { - "version": "2.0.0", - "license": "MIT", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-3.2.0.tgz", + "integrity": "sha512-sg8HqoTEulcbbbVXeg84u5UnlsQa8GS5QXMqjjYIhS4abEVVKIUwe0/l/UhrZdKaL/W5eWZNlbTeEIiOXTcsBQ==", "peerDependencies": { - "date-fns": ">=2.0.0" + "date-fns": "^3.0.0 || ^4.0.0" } }, "node_modules/dayjs": { diff --git a/package.json b/package.json index f4ac5dbe8c3b..96c4ec0ee14d 100644 --- a/package.json +++ b/package.json @@ -103,8 +103,8 @@ "babel-polyfill": "^6.26.0", "canvas-size": "^1.2.6", "core-js": "^3.32.0", - "date-fns": "^2.30.0", - "date-fns-tz": "^2.0.0", + "date-fns": "^4.1.0", + "date-fns-tz": "^3.2.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", "expensify-common": "2.0.94", diff --git a/patches/date-fns-tz+2.0.0.patch b/patches/date-fns-tz+2.0.0.patch deleted file mode 100644 index aa88f1443a79..000000000000 --- a/patches/date-fns-tz+2.0.0.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/node_modules/date-fns-tz/_lib/tzTokenizeDate/index.js b/node_modules/date-fns-tz/_lib/tzTokenizeDate/index.js -index 9222a61..8540224 100644 ---- a/node_modules/date-fns-tz/_lib/tzTokenizeDate/index.js -+++ b/node_modules/date-fns-tz/_lib/tzTokenizeDate/index.js -@@ -59,20 +59,23 @@ function hackyOffset(dtf, date) { - - var dtfCache = {}; - -+// New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12` -+const testDateFormatted = new Intl.DateTimeFormat('en-US', { -+ hourCycle: 'h23', -+ 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')) -+const hourCycleSupported = -+ testDateFormatted === '06/25/2014, 00:00:00' || -+ testDateFormatted === '‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00' -+ - function getDateTimeFormat(timeZone) { - if (!dtfCache[timeZone]) { -- // 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: 'numeric', -- 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, -diff --git a/node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js b/node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js -index cc1d143..17333cc 100644 ---- a/node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js -+++ b/node_modules/date-fns-tz/esm/_lib/tzTokenizeDate/index.js -@@ -48,23 +48,24 @@ function hackyOffset(dtf, date) { - // to get deterministic local date/time output according to the `en-US` locale which - // can be used to extract local time parts as necessary. - var dtfCache = {} -+ -+// New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12` -+const testDateFormatted = new Intl.DateTimeFormat('en-US', { -+ hourCycle: 'h23', -+ 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')) -+const hourCycleSupported = -+ testDateFormatted === '06/25/2014, 00:00:00' || -+ testDateFormatted === '‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00' -+ - function getDateTimeFormat(timeZone) { - if (!dtfCache[timeZone]) { -- // 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: 'numeric', -- 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,