-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with years parsing #7
Comments
Hi, yes I left it out deliberately because of the ambiguity, implication of relative timespans, and added work to support all possible "correct" values of "1 year" or "1 month". I also didn't have a use case. Can you tell me about yours? |
I was building an internal command line tool for generating licenses. The expiration parameter is parsed using this library. Licenses usually last for years, but when I entered "1 year" it failed to parse, which was unexpected initially. Setting 365 days is a good enough workaround for now though. |
Years parsing seems a bit weird: while this works
TimeSpanParser.Parse("0 years")
, neitherTimeSpanParser.Parse("1 years")
norTimeSpanParser.Parse("1 year")
work.Any ideas why this happens?
EDIT: Just noticed this in the readme: ". . . Other values for years/months are not currently accepted". Would be nice to have 1 year just equal 365 days or something in scenarios where leap year is not that important.
The text was updated successfully, but these errors were encountered: