chronotope / chrono

Date and time library for Rust
Other
3.3k stars 523 forks source link

Make Weekday::num_days_from public #1560

Closed NickUfer closed 6 months ago

NickUfer commented 6 months ago

Currently Weekday::num_days_from is only public inside the crate, but this function is useful for crates using this lib too. For example I had to write some code with different behavior for the united states and how they handle some things different than ISO 8601 and I could have used num_days_from_monday and num_days_from_sunday to solve my problem... but this requires another if statement which I could remove if Weekday::num_days_from was public. I'm pretty sure there are more use cases for this besides that.

pitdicker commented 6 months ago

I agree. #1249 is open to make it public with the name days_since.

pitdicker commented 6 months ago

It will be public in the next release.