Add first and last day of year methods#770
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #770 +/- ##
=======================================
- Coverage 94.2% 93.8% -0.4%
=======================================
Files 96 97 +1
Lines 10732 11172 +440
=======================================
+ Hits 10107 10475 +368
- Misses 625 697 +72 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
As stated in the "contributing" section of the README, it's best to open issues before working on an implementation. To put it simply, this is far from an ideal API because it's a method rather than an inherent function. Changing the time to midnight doesn't make any sense, either. I would be open to something like |
Simple convenience methods for getting the start of the first and last days of the year for
Date,PrimitiveDateTime, andOffsetDateTime. This is an easy ergonomics boost for the library, and is an infallible operation that is currently considered fallible with the existing API (usingreplace_ordinal).I didn't make a separate test file for these, but since the doc-tests cover the gamut of the operation I hope that's okay. If there actually are more cases and you'd like a test suite let me know.