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

Get rid of calculations inside the date-io #280

Open
dmtrKovalenko opened this issue Feb 6, 2020 · 0 comments
Open

Get rid of calculations inside the date-io #280

dmtrKovalenko opened this issue Feb 6, 2020 · 0 comments

Comments

@dmtrKovalenko
Copy link
Owner

dmtrKovalenko commented Feb 6, 2020

The main idea is to resolve #279 Treeshaking issue. Right now we fully depend on the date libraries for calculation of something. But maybe will be a better idea to provide an interface only for localization-related features (like formatting, parsing, getting day ranges)

Problem: no way to get some specific functionality outside of date-io quickly. Need to get a patch. Also if some consumer of date-io is not using one of the methods - they will not be treeshaked

Solution: Provide a method for converting value back to js date object like toJsDateObject and use date-fns functions for consumers. This will not generate a lot of bundlesize for end-users, because functions like this are really tiny. The most bloating part (formatting and parsing) we will not require anyway

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

No branches or pull requests

1 participant