dmtrKovalenko / dmtrKovalenko/date-io

Get rid of calculations inside the date-io

Open
#280 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
754
Forks
92
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/date-fns/date-fns/blob/master/src/isSameHour/index.js) are really tiny. The most bloating part (formatting and parsing) we will not require anyway

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.