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

Rework toDate and extract parseISO #1023

Merged
merged 7 commits into from Jan 9, 2019
Merged

Rework toDate and extract parseISO #1023

merged 7 commits into from Jan 9, 2019

Conversation

kossnocorp
Copy link
Member

@kossnocorp kossnocorp commented Dec 18, 2018

The PR is a result of an attempt to make minimal build size smaller. See #1015 for the background.

  • Extract parseISO from toDate
  • Make toDate accept only numbers and dates
  • Remove global options object
  • Fixes DST issue in eachDayOfInterval that caused time in the days after DST change to have the shift as well.

The results of the PR:

  • lightFormat: 1.73 KB887 B
  • toDate: 1.27 KB296 B
  • addDays: 1.31 KB385 B

For comparison, here are the v1 stats:

  • format: 2.77 KB
  • addDays: 983 B

- 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.
CHANGELOG.md Show resolved Hide resolved
docs/strings.md Outdated Show resolved Hide resolved
Copy link
Contributor

@leshakoss leshakoss left a comment

Choose a reason for hiding this comment

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

🏅 :shipit:

'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)'
]
)
Copy link
Member Author

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

@kossnocorp kossnocorp merged commit f6920b8 into master Jan 9, 2019
@kossnocorp kossnocorp deleted the 1016-parse-iso branch January 9, 2019 09:33
eostrom added a commit to eostrom/date-fns that referenced this pull request Mar 23, 2019
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants