We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
toDate
On daylight switching (2018-11-04) in Sao Paolo Brazil the toDate function returns a different date object then expected:
const toDate = require('date-fns/toDate'); const getDay = require('date-fns/getDay'); const nativeSunday = new Date(2018, 10, 4) console.log(nativeSunday) // 2018-11-04T03:00:00.000Z console.log(getDay(nativeSunday)) // 0 const dateFnsSunday = toDate('2018-11-04') console.log(dateFnsSunday) // 2018-11-04T02:00:00.000Z console.log(getDay(dateFnsSunday)) // 6
This problem only manifests itself if running in the Sao Paolo timezone. This can be tested by running:
env TZ='America/Sao_Paolo' node testScript.js
The text was updated successfully, but these errors were encountered:
#972 shows a similar issue for the formatting function.
Sorry, something went wrong.
Add regression test for #992
96ad40c
efdbf3b
This fix for this problem was released with v2.0.0-alpha.26 and v1.30.1.
v2.0.0-alpha.26
v1.30.1
See:
No branches or pull requests
On daylight switching (2018-11-04) in Sao Paolo Brazil the
toDate
function returns a different date object then expected:This problem only manifests itself if running in the Sao Paolo timezone. This can be tested by running:
env TZ='America/Sao_Paolo' node testScript.js
The text was updated successfully, but these errors were encountered: