Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update date-fns to v3 #265

Merged
merged 6 commits into from
Mar 16, 2024
Merged

Conversation

christopherklint97
Copy link
Contributor

@christopherklint97 christopherklint97 commented Dec 28, 2023

Summary

This PR updates date-fns to v3 and adds support for it. Some other minor changes include:

  • Adding @babel/preset-env and removing the individual babel plugin transforms since they are included.
  • Running xit on the tests that expected a RangeError. This error does not seem to occur anymore in date-fns v3 but have chosen not to remove it in case these tests want to be rewritten.

@antoinepairet
Copy link

We do not miss a loader, but we need to support https://babeljs.io/docs/babel-plugin-transform-logical-assignment-operators.

I understand that there are two options

  • explicitly use the plugin
  • use preset-env

Plugin

{
  "plugins": ["@babel/plugin-transform-logical-assignment-operators"]
}

@babel/preset-env

  "presets": [
    ["@babel/env", {
      "targets": ["2021"], // at least 2021
    }]

Here is a checklist for other changes we might need:

Copy link

@JeromeFitz JeromeFitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for kick-starting this @christopherklint97 ! Doing an update without changing a lot of the inner-workings may be the quickest path forward.

package.json Outdated Show resolved Hide resolved
src/format/index.js Outdated Show resolved Hide resolved
src/formatInTimeZone/index.js Outdated Show resolved Hide resolved
scripts/build/fp.js Outdated Show resolved Hide resolved
src/toDate/index.js Outdated Show resolved Hide resolved
src/utcToZonedTime/test.js Outdated Show resolved Hide resolved
.yarnrc.yml Outdated Show resolved Hide resolved
@marnusw
Copy link
Owner

marnusw commented Dec 28, 2023

Thanks everyone, I hope to find time for this soon.

@christopherklint97
Copy link
Contributor Author

Thanks for the reviews @antoinepairet @neilhem @JeromeFitz ! 🙌🏾

I got the tests to run now. Looks like 6 tests are failing at the moment, most are missing RangeErrors and some incorrect timezones.

$ yarn test

START:
ℹ 「wdm」: Built at: 12/29/2023 9:46:54 AM
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
⚠ 「wdm」: Built at: 12/29/2023 9:46:55 AM
Entrypoint ../test = ../test.js
[./node_modules/date-fns/format.js] 25.7 KiB {../test} [built]
[./node_modules/date-fns/locale/en-GB.js] 772 bytes {../test} [built]
[./node_modules/power-assert/index.js] 2.2 KiB {../test} [built]
[./src sync recursive \/test\.js$] ./src sync \/test\.js$ 460 bytes {../test} [built]
[./src/_lib/newDateUTC/test.js] 36.4 KiB {../test} [optional] [built]
[./src/_lib/tzIntlTimeZoneName/test.js] 22.4 KiB {../test} [optional] [built]
[./src/_lib/tzParseTimezone/test.js] 127 KiB {../test} [optional] [built]
[./src/_lib/tzTokenizeDate/test.js] 31.8 KiB {../test} [optional] [built]
[./src/format/test.js] 171 KiB {../test} [optional] [built]
[./src/formatInTimeZone/test.js] 16.4 KiB {../test} [optional] [built]
[./src/getTimezoneOffset/test.js] 100 KiB {../test} [optional] [built]
[./src/toDate/test.js] 255 KiB {../test} [optional] [built]
[./src/utcToZonedTime/test.js] 53.5 KiB {../test} [optional] [built]
[./src/zonedTimeToUtc/test.js] 89.8 KiB {../test} [optional] [built]
[./test.js] 124 bytes {../test} [built]
    + 241 hidden modules

WARNING in ./node_modules/power-assert-formatter/lib/create.js 30:28-49
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/power-assert-formatter/index.js
 @ ./node_modules/power-assert/index.js
 @ ./src/format/test.js
 @ ./src sync \/test\.js$
 @ ./test.js
ℹ 「wdm」: Compiled with warnings.
29 12 2023 09:46:55.911:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
29 12 2023 09:46:55.912:INFO [launcher]: Launching browsers LocalChrome with concurrency unlimited
29 12 2023 09:46:55.925:INFO [launcher]: Starting browser Chrome
29 12 2023 09:46:56.960:INFO [Chrome 120.0.0.0 (Mac OS 10.15.7)]: Connected on socket f5AV3NtniDRTrLKXAAAB with id 79769157

Finished in 0.004 secs / 0.023 secs @ 09:46:57 GMT+0100 (GMT+01:00)

SUMMARY:
✔ 259 tests completed
ℹ 1 test skipped
✖ 6 tests failed

FAILED TESTS:
  format
    ✖ throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined
      Chrome 120.0.0.0 (Mac OS 10.15.7)
    AssertionError: Missing expected exception (RangeError)..
        at _throws (webpack:///node_modules/assert/assert.js:454:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1163:5)
        at ./node_modules/assert/assert.js.assert.throws (webpack:///node_modules/assert/assert.js:478:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1187:3)
        at Context.<anonymous> (webpack:///src/format/test.js:865:12 <- /Users/christopherklint/coding/date-fns-tz/test.js:29176:26)

    ✖ throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined
      Chrome 120.0.0.0 (Mac OS 10.15.7)
    AssertionError: Missing expected exception (RangeError)..
        at _throws (webpack:///node_modules/assert/assert.js:454:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1163:5)
        at ./node_modules/assert/assert.js.assert.throws (webpack:///node_modules/assert/assert.js:478:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1187:3)
        at Context.<anonymous> (webpack:///src/format/test.js:873:12 <- /Users/christopherklint/coding/date-fns-tz/test.js:29183:26)

    time zone
      ✖ Local date with specific non-location time zone
        Chrome 120.0.0.0 (Mac OS 10.15.7)
      AssertionError:   # src/format/test.js:669

        assert(result === dateAndTimeZoneAmericaNY)
               |      |   |
               |      |   "1986-04-04 10:32:55 EST"
               |      false
               "1986-04-04 10:32:55 GMT-5"

        --- [string] dateAndTimeZoneAmericaNY
        +++ [string] result
        @@ -17,7 +17,9 @@
         :55
        -EST
        +GMT-5


          at ./node_modules/empower-core/lib/decorator.js.Decorator._callFunc (webpack:///node_modules/empower-core/lib/decorator.js:110:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:12223:20)
          at ./node_modules/empower-core/lib/decorator.js.Decorator.concreteAssert (webpack:///node_modules/empower-core/lib/decorator.js:103:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:12216:17)
          at decoratedAssert (webpack:///node_modules/empower-core/lib/decorate.js:49:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:12084:30)
          at powerAssert (webpack:///node_modules/empower-core/index.js:63:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:12007:32)
          at Context.<anonymous> (webpack:///src/format/test.js:669:13 <- /Users/christopherklint/coding/date-fns-tz/test.js:28804:32)

      ✖ https://github.com/marnusw/date-fns-tz/issues/138
        Chrome 120.0.0.0 (Mac OS 10.15.7)
      AssertionError:   # src/format/test.js:685

        assert.equal(result, '2020-10-31 9:37pm -05:00 -05:00 GMT-5 CDT')
                     |
                     "2020-10-31 9:37pm -05:00 -05:00 GMT-5 GMT-5"

          at ./node_modules/empower-core/lib/decorator.js.Decorator._callFunc (webpack:///node_modules/empower-core/lib/decorator.js:110:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:12223:20)
          at ./node_modules/empower-core/lib/decorator.js.Decorator.concreteAssert (webpack:///node_modules/empower-core/lib/decorator.js:103:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:12216:17)
          at Function.decoratedAssert [as equal] (webpack:///node_modules/empower-core/lib/decorate.js:49:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:12084:30)
          at Context.<anonymous> (webpack:///src/format/test.js:685:14 <- /Users/christopherklint/coding/date-fns-tz/test.js:28837:28)

    custom locale
      ✖ throws `RangeError` if `options.locale` doesn't have `localize` property
        Chrome 120.0.0.0 (Mac OS 10.15.7)
      AssertionError: Missing expected exception (RangeError)..
          at _throws (webpack:///node_modules/assert/assert.js:454:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1163:5)
          at ./node_modules/assert/assert.js.assert.throws (webpack:///node_modules/assert/assert.js:478:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1187:3)
          at Context.<anonymous> (webpack:///src/format/test.js:844:14 <- /Users/christopherklint/coding/date-fns-tz/test.js:29157:28)

      ✖ throws `RangeError` if `options.locale` doesn't have `formatLong` property
        Chrome 120.0.0.0 (Mac OS 10.15.7)
      AssertionError: Missing expected exception (RangeError)..
          at _throws (webpack:///node_modules/assert/assert.js:454:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1163:5)
          at ./node_modules/assert/assert.js.assert.throws (webpack:///node_modules/assert/assert.js:478:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:1187:3)
          at Context.<anonymous> (webpack:///src/format/test.js:856:14 <- /Users/christopherklint/coding/date-fns-tz/test.js:29168:28)

@marnusw you probably know best here if we should keep the RangError checks and implement them in date-fns-tz or just remove them?

@JeromeFitz
Copy link

JeromeFitz commented Dec 29, 2023

Thanks for making the time on the latest and greatest. Awesome, work @christopherklint97 !

For the RangeError ones date-fns@3 introduced types to inform the developer that they shouldn't do these things. So that may mean that intentionally breaking in a test will no longer work, since the errors themselves have changed. (I ran into these exact ones in an out-of-scope move to types.)

But would defer to someone who knows more on this package and karma for sure.

For this one though:

throws RangeError if options.firstWeekContainsDate is not convertable to 1, 2, ..., 7 or undefined

This changed to only allow 1 | 4 in date-fns@3 (in 2021):

I believe this should also happen in date-fns-tz given the comments in date-fns code (reference in #2427). If so this would need to be changed in a few references:

Every index.js.flow would get their update in the next build per the current structure.

Though now that date-fns@3 exports types this could be changed further in typings.d.ts:

  • Some other slight changes with weekStartsOn|unit|roundingMethod should be confirmed if date-fns-tz has different values or should be kept in-sync.
import type { Day, FirstWeekContainsDate, LocaleUnit, RoundingMethod } from "date-fns";
import type { Locale } from 'date-fns'

type OptionsWithTZ = {
  weekStartsOn?: Day,
  firstWeekContainsDate?: FirstWeekContainsDate,
  additionalDigits?: 0 | 1 | 2,
  timeZone?: string,
  locale?: Locale,
  includeSeconds?: boolean,
  addSuffix?: boolean,
  unit?: LocaleUnit,
  roundingMethod?: RoundingMethod,
  awareOfUnicodeTokens?: boolean,
}

declare module.exports: (
  date: Date | string | number,
  timeZone: string,
  formatStr: string,
  options?: OptionsWithTZ
) => string

This is looking real good! Props again! 🎉


Additional Edit:

The Local date with specific non-location time zone error looks to be local on your machine. None of the Ci/CD have it, nor do I. (Who happens to be dateAndTimeZoneAmericaNY.)

Wonder if running:

env TZ=utc yarn run test

Would work locally?

But it is looking just like the RangeErrors:

SUMMARY:
✔ 261 tests completed
ℹ 1 test skipped
✖ 4 tests failed

A potential option if the tests should be kept in until date-fns-tz moves to types or something, their functions could be changed to xit which will tell karma to ignore the test.

package.json Outdated Show resolved Hide resolved
@JeromeFitz
Copy link

JeromeFitz commented Dec 29, 2023

Aye ... digging into this a bit more if the move to date-fns@3 types is to accompany.

The three places of change are:

1️⃣

./scripts/build/_lib/typings/formatBlock.js

L114:

"import type { Day, FirstWeekContainsDate, Locale, LocaleUnit, RoundingMethod } from 'date-fns'\n" +

2️⃣

./scripts/build/_lib/typings/typeScript.js

L296:

      import type { Day, FirstWeekContainsDate, Locale, LocaleUnit, RoundingMethod } from "date-fns"

3️⃣

./docs/OptionsWithTZ.js

Then editing the way they are currently formatted with flow

L9:

 * @property {Day} [weekStartsOn=0] - the index of the first day of the week (0 - Sunday).

L13:

 * @property {FirstWeekContainsDate} [firstWeekContainsDate=1] - the day of January,

L29:

 * @property {LocaleUnit} [unit] - used by `formatDistanceStrict`.

L31:

 * @property {RoundingMethod} [roundingMethod='floor'] - used by `formatDistanceStrict`.

Then after a yarn run build that will update the rest of the files accordingly. 😅

@@ -1,4 +1,4 @@
import dateFnsFormat from 'date-fns/format/index.js'
import { format as dateFnsFormat } from 'date-fns/format.js'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { format as dateFnsFormat } from 'date-fns/format.js'
import { format as dateFnsFormat } from 'date-fns'

To avoid any further path change, maybe we should refer to global package ? It works and it's not path-specific, so more secure (imho).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about this as well, but when I try to do this then I get errors.. 🤔

$ yarn test

START:
ℹ 「wdm」: Built at: 01/08/2024 8:58:09 AM
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
✖ 「wdm」: Built at: 01/08/2024 8:58:11 AM
Entrypoint ../test = ../test.js
[./node_modules/date-fns/index.mjs] 8.8 KiB {../test} [built]
[./node_modules/date-fns/locale/en-GB.js] 772 bytes {../test} [built]
[./node_modules/power-assert/index.js] 2.2 KiB {../test} [built]
[./src sync recursive \/test\.js$] ./src sync \/test\.js$ 460 bytes {../test} [built]
[./src/_lib/newDateUTC/test.js] 36.4 KiB {../test} [optional] [built]
[./src/_lib/tzIntlTimeZoneName/test.js] 22.4 KiB {../test} [optional] [built]
[./src/_lib/tzParseTimezone/test.js] 127 KiB {../test} [optional] [built]
[./src/_lib/tzTokenizeDate/test.js] 31.8 KiB {../test} [optional] [built]
[./src/format/test.js] 171 KiB {../test} [optional] [built]
[./src/formatInTimeZone/test.js] 16.4 KiB {../test} [optional] [built]
[./src/getTimezoneOffset/test.js] 100 KiB {../test} [optional] [built]
[./src/toDate/test.js] 255 KiB {../test} [optional] [built]
[./src/utcToZonedTime/test.js] 53.5 KiB {../test} [optional] [built]
[./src/zonedTimeToUtc/test.js] 89.8 KiB {../test} [optional] [built]
[./test.js] 124 bytes {../test} [built]
    + 510 hidden modules

WARNING in ./node_modules/power-assert-formatter/lib/create.js 30:28-49
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/power-assert-formatter/index.js
 @ ./node_modules/power-assert/index.js
 @ ./src/getTimezoneOffset/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 96:9-27
Can't import the named export 'AMPMMidnightParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 95:9-19
Can't import the named export 'AMPMParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 89:9-19
Can't import the named export 'DateParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse.mjs 352:23-49
Can't import the named export 'DateToSystemTimezoneSetter' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 90:9-24
Can't import the named export 'DayOfYearParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 91:9-18
Can't import the named export 'DayParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 97:9-24
Can't import the named export 'DayPeriodParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 78:9-18
Can't import the named export 'EraParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 82:9-27
Can't import the named export 'ExtendedYearParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 104:9-31
Can't import the named export 'FractionOfSecondParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 100:9-24
Can't import the named export 'Hour0To11Parser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 99:9-24
Can't import the named export 'Hour0to23Parser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 101:9-24
Can't import the named export 'Hour1To24Parser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 98:9-24
Can't import the named export 'Hour1to12Parser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 94:9-21
Can't import the named export 'ISODayParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 106:9-26
Can't import the named export 'ISOTimezoneParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 105:9-31
Can't import the named export 'ISOTimezoneWithZParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 88:9-22
Can't import the named export 'ISOWeekParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 81:9-26
Can't import the named export 'ISOWeekYearParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 92:9-23
Can't import the named export 'LocalDayParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 87:9-24
Can't import the named export 'LocalWeekParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 80:9-28
Can't import the named export 'LocalWeekYearParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 102:9-21
Can't import the named export 'MinuteParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 85:9-20
Can't import the named export 'MonthParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 83:9-22
Can't import the named export 'QuarterParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 103:9-21
Can't import the named export 'SecondParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 93:9-33
Can't import the named export 'StandAloneLocalDayParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 86:9-30
Can't import the named export 'StandAloneMonthParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 84:9-32
Can't import the named export 'StandAloneQuarterParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 108:9-36
Can't import the named export 'TimestampMillisecondsParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 107:9-31
Can't import the named export 'TimestampSecondsParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers.mjs 79:9-19
Can't import the named export 'YearParser' from non EcmaScript module (only default export is available)
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/YearParser.mjs 13:11
Module parse failed: Unexpected token (13:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
| export class YearParser extends Parser {
>   priority = 130;
|   incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|   parse(dateString, token, match) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 2:0-54 79:9-19
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/EraParser.mjs 3:11
Module parse failed: Unexpected token (3:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { Parser } from "../Parser.mjs";
| export class EraParser extends Parser {
>   priority = 140;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 1:0-52 78:9-18
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs 4:11
Module parse failed: Unexpected token (4:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { dayPeriodEnumToHours } from "../utils.mjs";
| export class AMPMMidnightParser extends Parser {
>   priority = 80;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 19:0-70 96:9-27
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs 4:11
Module parse failed: Unexpected token (4:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { dayPeriodEnumToHours } from "../utils.mjs";
| export class AMPMParser extends Parser {
>   priority = 80;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 18:0-54 95:9-19
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs 4:11
Module parse failed: Unexpected token (4:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { mapValue, parseNDigits } from "../utils.mjs";
| export class FractionOfSecondParser extends Parser {
>   priority = 30;
|   parse(dateString, token) {
|     const valueCallback = value => Math.floor(value * Math.pow(10, -token.length + 3));
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 27:0-78 104:9-31
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs 4:11
Module parse failed: Unexpected token (4:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits } from "../utils.mjs";
| export class QuarterParser extends Parser {
>   priority = 120;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 6:0-60 83:9-22
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs 4:11
Module parse failed: Unexpected token (4:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits } from "../utils.mjs";
| export class StandAloneQuarterParser extends Parser {
>   priority = 120;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 7:0-80 84:9-32
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs 4:11
Module parse failed: Unexpected token (4:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigitsSigned } from "../utils.mjs";
| export class ExtendedYearParser extends Parser {
>   priority = 130;
|   parse(dateString, token) {
|     if (token === "u") {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 5:0-70 82:9-27
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { isLeapYearIndex, parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class DayOfYearParser extends Parser {
>   priority = 90;
|   subpriority = 1;
|   parse(dateString, token, match) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 13:0-64 90:9-24
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { mapValue, parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class StandAloneMonthParser extends Parser {
>   priority = 110;
|   parse(dateString, token, match) {
|     const valueCallback = value => value - 1;
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 9:0-76 86:9-30
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseAnyDigitsSigned } from "../utils.mjs";
| export class TimestampMillisecondsParser extends Parser {
>   priority = 20;
|   parse(dateString) {
|     return parseAnyDigitsSigned(dateString);
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 31:0-88 108:9-36
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseAnyDigitsSigned } from "../utils.mjs";
| export class TimestampSecondsParser extends Parser {
>   priority = 40;
|   parse(dateString) {
|     return parseAnyDigitsSigned(dateString);
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 30:0-78 107:9-31
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class Hour0To11Parser extends Parser {
>   priority = 70;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 23:0-64 100:9-24
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class Hour0to23Parser extends Parser {
>   priority = 70;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 22:0-64 99:9-24
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class Hour1To24Parser extends Parser {
>   priority = 70;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 24:0-64 101:9-24
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class Hour1to12Parser extends Parser {
>   priority = 70;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 21:0-64 98:9-24
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class MinuteParser extends Parser {
>   priority = 60;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 25:0-58 102:9-21
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs 5:11
Module parse failed: Unexpected token (5:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class SecondParser extends Parser {
>   priority = 50;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 26:0-58 103:9-21
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/Setter.mjs 5:14
Module parse failed: Unexpected token (5:14)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| const TIMEZONE_UNIT_PRIORITY = 10;
| export class Setter {
>   subPriority = 0;
|   validate(_utcDate, _options) {
|     return true;
 @ ./node_modules/date-fns/parse.mjs 8:0-69 352:23-49
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs 5:21
Module parse failed: Unexpected token (5:21)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| import { mapValue, parseNDigits, parseNumericPattern } from "../utils.mjs";
| export class MonthParser extends Parser {
>   incompatibleTokens = ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"];
|   priority = 110;
|   parse(dateString, token, match) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 8:0-56 85:9-20
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/DayParser.mjs 6:11
Module parse failed: Unexpected token (6:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Day of week
| export class DayParser extends Parser {
>   priority = 90;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 14:0-52 91:9-18
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs 6:11
Module parse failed: Unexpected token (6:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // in the morning, in the afternoon, in the evening, at night
| export class DayPeriodParser extends Parser {
>   priority = 80;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 20:0-64 97:9-24
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs 7:11
Module parse failed: Unexpected token (7:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // ISO day of week
| export class ISODayParser extends Parser {
>   priority = 90;
|   parse(dateString, token, match) {
|     const valueCallback = value => {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 17:0-58 94:9-21
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs 7:11
Module parse failed: Unexpected token (7:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Local day of week
| export class LocalDayParser extends Parser {
>   priority = 90;
|   parse(dateString, token, match, options) {
|     const valueCallback = value => {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 15:0-62 92:9-23
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs 7:11
Module parse failed: Unexpected token (7:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Stand-alone local day of week
| export class StandAloneLocalDayParser extends Parser {
>   priority = 90;
|   parse(dateString, token, match, options) {
|     const valueCallback = value => {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 16:0-82 93:9-33
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs 8:11
Module parse failed: Unexpected token (8:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // ISO week-numbering year
| export class ISOWeekYearParser extends Parser {
>   priority = 130;
|   parse(dateString, token) {
|     if (token === "R") {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 4:0-68 81:9-26
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs 8:11
Module parse failed: Unexpected token (8:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Local week-numbering year
| export class LocalWeekYearParser extends Parser {
>   priority = 130;
|   parse(dateString, token, match) {
|     const valueCallback = year => ({
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 3:0-72 80:9-28
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/DateParser.mjs 9:11
Module parse failed: Unexpected token (9:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Day of the month
| export class DateParser extends Parser {
>   priority = 90;
|   subPriority = 1;
|   parse(dateString, token, match) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 12:0-54 89:9-19
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs 9:11
Module parse failed: Unexpected token (9:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // ISO week of year
| export class ISOWeekParser extends Parser {
>   priority = 100;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 11:0-60 88:9-22
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs 9:11
Module parse failed: Unexpected token (9:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Local week of year
| export class LocalWeekParser extends Parser {
>   priority = 100;
|   parse(dateString, token, match) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 10:0-64 87:9-24
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs 9:11
Module parse failed: Unexpected token (9:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Timezone (ISO-8601)
| export class ISOTimezoneParser extends Parser {
>   priority = 10;
|   parse(dateString, token) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 29:0-68 106:9-26
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js

ERROR in ./node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs 9:11
Module parse failed: Unexpected token (9:11)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // Timezone (ISO-8601. +00:00 is `'Z'`)
| export class ISOTimezoneWithZParser extends Parser {
>   priority = 10;
|   parse(dateString, token) {
|     switch (token) {
 @ ./node_modules/date-fns/parse/_lib/parsers.mjs 28:0-78 105:9-31
 @ ./node_modules/date-fns/parse.mjs
 @ ./node_modules/date-fns/index.mjs
 @ ./src/utcToZonedTime/test.js
 @ ./src sync \/test\.js$
 @ ./test.js
ℹ 「wdm」: Failed to compile.
08 01 2024 08:58:11.335:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
08 01 2024 08:58:11.335:INFO [launcher]: Launching browsers LocalChrome with concurrency unlimited
08 01 2024 08:58:11.339:INFO [launcher]: Starting browser Chrome
08 01 2024 08:58:15.698:INFO [Chrome 120.0.0.0 (Mac OS 10.15.7)]: Connected on socket M-sl7g7Es8dIyBjSAAAB with id 52467360
Chrome 120.0.0.0 (Mac OS 10.15.7) ERROR
  Uncaught Error: Module parse failed: Unexpected token (3:11)
  File was processed with these loaders:
   * ./node_modules/babel-loader/lib/index.js
  You may need an additional loader to handle the result of these loaders.
  | import { Parser } from "../Parser.mjs";
  | export class EraParser extends Parser {
  >   priority = 140;
  |   parse(dateString, token, match) {
  |     switch (token) {
  at /Users/christopherklint/coding/date-fns-tz/test.js:21074:1

  Error: Module parse failed: Unexpected token (3:11)
  File was processed with these loaders:
   * ./node_modules/babel-loader/lib/index.js
  You may need an additional loader to handle the result of these loaders.
  | import { Parser } from "../Parser.mjs";
  | export class EraParser extends Parser {
  >   priority = 140;
  |   parse(dateString, token, match) {
  |     switch (token) {
      at ./node_modules/date-fns/parse/_lib/parsers/EraParser.mjs (/Users/christopherklint/coding/date-fns-tz/test.js:21074:7)
      at __webpack_require__ (webpack:///webpack/bootstrap:19:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:20:30)
      at ./node_modules/date-fns/parse/_lib/parsers.mjs (webpack:///node_modules/date-fns/parse/_lib/parsers.mjs:1:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:20858:80)
      at __webpack_require__ (webpack:///webpack/bootstrap:19:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:20:30)
      at ./node_modules/date-fns/parse.mjs (webpack:///node_modules/date-fns/parse.mjs:1:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:20387:80)
      at __webpack_require__ (webpack:///webpack/bootstrap:19:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:20:30)
      at ./node_modules/date-fns/isMatch.mjs (webpack:///node_modules/date-fns/isMatch.mjs:1:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:15953:68)
      at __webpack_require__ (webpack:///webpack/bootstrap:19:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:20:30)
      at ./node_modules/date-fns/index.mjs (webpack:///node_modules/date-fns/index.mjs:1:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:14389:72)
      at __webpack_require__ (webpack:///webpack/bootstrap:19:1 <- /Users/christopherklint/coding/date-fns-tz/test.js:20:30)

Finished in 0.138 secs / 0 secs @ 08:58:15 GMT+0100 (GMT+01:00)

SUMMARY:
✔ 0 tests completed

richrace added a commit to ministryofjustice/bichard7-next-ui that referenced this pull request Jan 5, 2024
The version of date-fns we're using is v2.3, and it's been upgraded to v3 with breaking changes.

I've pinned the current version we are using at v2.3 until this gets merged marnusw/date-fns-tz#265
@christopherklint97
Copy link
Contributor Author

@marnusw all tests are passing now since I am xiting the RangeError tests. All you have to do is merge and release a new version if you are happy 😉

@JeromeFitz I really appreciate the comments here and making it so easy for me to copy and paste the changes 👍🏾

@gehringf
Copy link

gehringf commented Jan 8, 2024

Looking forward to this 😃

yarn.lock Outdated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly 2k lines added here which is maybe disproportionate to the packages added? Did you run yarn dedupe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I ran yarn dedupe but it did not change anything unfortunately.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.yarn/releases/yarn-3.6.4.cjs adds around 900 lines, so roughly half. Guess that's not too bad..

kuus added a commit to knitkode/koine that referenced this pull request Jan 11, 2024
@tomalaforge
Copy link

Hello, what is the status of this PR? Thanks

@christopherklint97
Copy link
Contributor Author

Hello, what is the status of this PR? Thanks

@tomalaforge I would say status here is awaiting a review and possible merge from @marnusw if he is happy with the changes.

@bosticka
Copy link

@christopherklint97, thanks for this PR! I hope @marnusw merges soon.

@joacub
Copy link

joacub commented Jan 22, 2024

please merge 👯

@Minho-Lee
Copy link

When merge? 👁️ 👄 👁️

@keesvanbemmel
Copy link

keesvanbemmel commented Feb 7, 2024

Hi all, thank you very much for all this work! I will do my best to get to this and merge it within a week or so.

Any news @marnusw ?

For people looking at a solution now: https://www.npmjs.com/package/date-fns-tz-v3

@gehringf
Copy link

Hi all, thank you very much for all this work! I will do my best to get to this and merge it within a week or so.

Any news @marnusw ?

For people looking at a solution now: https://www.npmjs.com/package/date-fns-tz-v3

@marnusw I don't understand why this linked package exists. Should we use that or wait for this PR?

@L4Ph
Copy link

L4Ph commented Feb 15, 2024

Hi all, thank you very much for all this work! I will do my best to get to this and merge it within a week or so.

Any news @marnusw ?
For people looking at a solution now: https://www.npmjs.com/package/date-fns-tz-v3

@marnusw I don't understand why this linked package exists. Should we use that or wait for this PR?

No, sir.
This library should not be used.
The following repo will tell you all you need to know

https://github.com/davidramosweb/date-fns-tz

@gehringf
Copy link

No, sir. This library should not be used. The following repo will tell you all you need to know

https://github.com/davidramosweb/date-fns-tz

Thanks for pointing it out. The npm page for it is super misleading and makes you think @marnusw released it.
image

@keesvanbemmel
Copy link

No, sir. This library should not be used. The following repo will tell you all you need to know
https://github.com/davidramosweb/date-fns-tz

Thanks for pointing it out. The npm page for it is super misleading and makes you think @marnusw released it. image

Misleading indeed! had me fooled :(

@keesvanbemmel
Copy link

Does anyone have a working solution other than waiting for this PR to be merged? I don't want to wait any longer.

@stephenhmarsh
Copy link

@keesvanbemmel if you really can't wait you can npm install from any github repo or branch, including the branch for this PR (christopherklint97:update-to-v3).

@keesvanbemmel
Copy link

@keesvanbemmel if you really can't wait you can npm install from any github repo or branch, including the branch for this PR (christopherklint97:update-to-v3).

Thanks will do!

@@ -1,5 +1,4 @@
import toInteger from 'date-fns/_lib/toInteger/index.js'
import getTimezoneOffsetInMilliseconds from 'date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js'
import { getTimezoneOffsetInMilliseconds } from 'date-fns/_lib/getTimezoneOffsetInMilliseconds.js'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried your fork on my ESM project and this import fails because it is not exported by date-fns

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: 
Package subpath './_lib/getTimezoneOffsetInMilliseconds.js' is not defined by "exports" in 
/../date-fns-tz/node_modules/date-fns/package.json 
imported from 
/../date-fns-tz/esm/toDate/index.js

I can patch date-fns to export it, but not sure what would be a better long term solution

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cellule did you find a resolution for this? I have the same error.

@BlindDespair
Copy link

Can we have a release please? Installing from branch may be okay for development but launching a product to production with a dependency like that is not safe. I cannot start using this library because our project was started with date-fns v3 and downgrading is more effort than what it's worth. I get that maintainers may be busy people, but someone already put time and effort into making this PR while community keeps begging for this to be released.

@tomalaforge
Copy link

I know that maintaining a OSS is a lot of work. I'm maintaining one myself. But here, everything has been done. I don't understand what is stopping you from merging and publishing a new version. It should take 30min max. 🙏

@stephenhmarsh
Copy link

stephenhmarsh commented Feb 25, 2024

In defense of @marnusw this is a new major version with breaking changes and maybe he needs time to consider the implications and how to document. Besides the imports, several tests were turned off because they no longer throw expected errors. If you think installing from a branch is "not safe," publishing a major version without fully understanding the breaking changes is worse. There's literally a comment right above @BlindDespair with a bug.

You can always clone the PR branch to your own repo and lock your install to the exact commit SHA. That's really as safe as you can you can ask for, especially if you're so personally sure this code is 100% ready and @marnusw has no reason not to merge it.

@BlindDespair
Copy link

@stephenhmarsh that is so, but this package is linked by date-fns' documentation as go-to solution for working with timezones when using date-fns. Normally other libraries or frameworks update together around the same time, meaning date-fns-tz would take care of these changes before v3 was even released on the main package. Otherwise the date-fns package shouldn't link to this package and not claim that there's a way to work with timezones and maybe explicitly state that their package is not recommended if timezones are necessary.

@SheldonWBM
Copy link

"Patience is a virtue". Does v2 have any security implications, not yet. Is this being worked on for free, yes.

@joserodrigorojo
Copy link

Please merge @marnusw 🙏

@lobaak
Copy link

lobaak commented Mar 6, 2024

Please merge @marnusw 🙇‍♂️

@veeramarni
Copy link

@marnusw anything pending for this PR to be merged? If possible release a beta

@SheldonWBM
Copy link

@marnusw anything pending for this PR to be merged? If possible release a beta

A beta can be official or, use this branch directly. See https://martinwolf.org/2018/04/github-branch-as-dependency-package-json/
Then you can help troubleshoot but, I would not use it for production.

@marnusw
Copy link
Owner

marnusw commented Mar 11, 2024

@christopherklint97 after merging some other PRs and upgrading to yearn 4.1.1 when I rebase your branch or merge master into it the tests fail on optional chaining errors from date-fns for some reason. When I just upgrade your branch to yarn 4.1.1 it still works fine though, so that doesn't seem like it can be the cause. I couldn't figure it out over the weekend but I'll take another look later this week. I just thought I'd post this for the record in case you or anyone else had some thoughts.

@joacub
Copy link

joacub commented Mar 11, 2024

This pull is wrong still having many issues in imports

@marnusw marnusw merged commit 4fd34ec into marnusw:master Mar 16, 2024
3 checks passed
@christopherklint97 christopherklint97 deleted the update-to-v3 branch March 18, 2024 06:15
@marnusw
Copy link
Owner

marnusw commented Mar 18, 2024

3.0.0-beta.0 is available. There will be some minor breaking changes in the final release which I still need to get to (function name changes, bringing some aspects in line with the new date-fns way of doing things - nothing major), but at least you have this to install from npm now! Thanks again @christopherklint97.

@Fouzyyyy
Copy link

@marnusw is there a draft PR or so we could watch for the next release? Because currently we don't want to ship a library in beta version, we would rather stick to the v2 in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet