You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find myself in the situation where I need to parse ISO weeks quite frequently. Especially when it comes to "manufacturing dates", which are very often given as iso weeks like 2024-W30 or even 202430.
My current workaround is to go through a NaiveDate first:
fnparse_iso_week(s:&str) -> ParseResult<IsoWeek>{let date = NaiveDate::parse_from_str(&format!("{s} 1"),"%G-W%V %u").unwrap();Ok(date.iso_week())}// parse_iso_week("2024-W30")
Do you think it would make sense to add this feature natively to chrono? Unfortunately the Parsed::to_naive_date implementation is quite daunting, otherwise I would've already created a proof of concept PR.
The text was updated successfully, but these errors were encountered:
I find myself in the situation where I need to parse ISO weeks quite frequently. Especially when it comes to "manufacturing dates", which are very often given as iso weeks like
2024-W30
or even202430
.My current workaround is to go through a
NaiveDate
first:Do you think it would make sense to add this feature natively to chrono? Unfortunately the
Parsed::to_naive_date
implementation is quite daunting, otherwise I would've already created a proof of concept PR.The text was updated successfully, but these errors were encountered: