effect
effect copied to clipboard
Add Date module
Type
- [ ] Refactor
- [X] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
Add Date module.
Related
N/A
Questions from me
Hi, my first time contributing to this! Hopefully this module is valuable and well-written.
I had some questions about code style and documentation.
First - @since
tags - who adds these? I don't think I can do it since I don't know which version this might be added to.
Second - Predicate-based dual api functions. I've never seen these in Effect, but there are a few functions that offer optional arguments with default values, such as the week functions and their dowOffset
. There's no difference between these usages:
pipe(Date.create(), Date.toWeekNumber)
pipe(Date.create(), Date.toWeekNumber(1))
...and TypeScript has no problem figuring out which overload to use, but it's a bit confusing to read.
Third - Is there some requirement for test coverage? I've added tests for everything that might be considered complex, but a lot of functions are also extremely trivial.
Fourth - I've added a lot in here and surely cover all the basics, but there's surely also more inspiration I could take from projects like date-fns
. How comprehensive is something like this expected to be before it's accepted?
Thanks!