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
Rework toDate and extract parseISO #1023
Conversation
3b60192
to
48bbe0a
Compare
- Extract parseISO from toDate - Make toDate accept only numbers and dates
Fix DST issue in `eachDayOfInterval` that caused time in the days after DST change to have the shift as well.
48bbe0a
to
838ed9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏅
'Fri Mar 27 2020 01:00:00 GMT+0300 (Eastern European Summer Time)', | ||
'Sat Mar 28 2020 00:00:00 GMT+0300 (Eastern European Summer Time)' | ||
] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've messed up with the rebase, so for those who are looking for the actual fix: https://github.com/date-fns/date-fns/pull/1023/files#diff-5a48fe3ae25f8ac62336262cb0acd5e2
Looks like this was updated when `parse` was renamed to `toDate`, (date-fns#375), but fell behind when ISO parsing was extracted from `toDate` into `parseISO` (date-fns#1023).
The PR is a result of an attempt to make minimal build size smaller. See #1015 for the background.
parseISO
fromtoDate
toDate
accept only numbers and dateseachDayOfInterval
that caused time in the days after DST change to have the shift as well.The results of the PR:
lightFormat
:1.73 KB
→887 B
toDate
:1.27 KB
→296 B
addDays
:1.31 KB
→385 B
For comparison, here are the v1 stats:
format
:2.77 KB
addDays
:983 B