You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an weired issue parsing quarter notations to an Date using the date-fns/parse()-Function.
Quarters notated in the pattern qqq/yyyy result in Q2/2020 (April 1st 2020) for the following Inputs:
Q2/2020
Q3/2020
Q4/2020
Tested with Locale de and en as well as upper-case QQQ and lower-case qqq.
However using the pattern yyyy-qqq works as expected.
I have an weired issue parsing quarter notations to an
Date
using thedate-fns/parse()
-Function.Quarters notated in the pattern
qqq/yyyy
result in Q2/2020 (April 1st 2020) for the following Inputs:Q2/2020
Q3/2020
Q4/2020
Tested with Locale
de
anden
as well as upper-caseQQQ
and lower-caseqqq
.However using the pattern
yyyy-qqq
works as expected.Versions tested: 2.9.0, 2.10.0
Versions affected: 2.9.0, 2.10.0
Side Note
After further analysis it seems that the first digit succeeding the Slash limits the resulting quarters.
*/1999
-> Q1, Q1, Q1, Q1*/2000
-> Q1, Q2, Q2, Q2*/3000
-> Q1, Q2, Q3, Q3*/4000
-> Q1, Q2, Q3, Q4qqq/yyyy
ExampleOutput
in: Q1/2020; parsed: Wed Jan 01 2020 00:00:00 GMT+0100 (Mitteleuropäische Normalzeit); formatted: Q1/2020
in: Q2/2020; parsed: Wed Apr 01 2020 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit); formatted: Q2/2020
Q3/2020; parsed: Wed Apr 01 2020 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit); formatted: Q2/2020
Q4/2020; parsed: Wed Apr 01 2020 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit); formatted: Q2/2020
yyyy-qqq
ExampleOutput
in: 2020-Q1; parsed: Wed Jan 01 2020 00:00:00 GMT+0100 (Mitteleuropäische Normalzeit); formatted: 2020-Q1
in: 2020-Q2; parsed: Wed Apr 01 2020 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit); formatted: 2020-Q2
in: 2020-Q3; parsed: Wed Jul 01 2020 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit); formatted: 2020-Q3
in: 2020-Q4; parsed: Thu Oct 01 2020 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit); formatted: 2020-Q4
The text was updated successfully, but these errors were encountered: