Open jonas-schievink opened 7 years ago
This sounds like a strtotime
-esque niche crate! I think it's useful to have but not a scope of the main crate. Probably it's in the scope of the Chronotope organization however.
I too would like to see this, but I keep jumping around too much to learn nom well enough to do something about it.
Sounds like something that would fit well in the humantime crate (it currently only supports parsing durations). https://github.com/tailhook/humantime
This would be really useful. I've some tasks to start daily from a certain time. Currently I've much boilerplate code which breaks with every chrono release just to parse a user %H:%M which is added to the current date and then checked whether we've to wait for tomorrow or can schedule this already today.
It would be nice if
chrono
(or another crate, really) offered more ways of parsing date and time strings that come from user input. These strings often don't fully specify aDateTime
, so I'd like to use the current date as a sort of "fallback" (imagine that the user wants to set a timer to fire today at 12:30, so they just enter "12:30" and expect it to work).Currently,
chrono
just bails when a parsed string doesn't fully specify aDateTime
.