Closed Deuchnord closed 4 years ago
I have implemented the basics of this (https://github.com/Brainface1/kosmorro) however i have two questions:
Hello, thanks for your work! Feel free to open a PR when you want :)
I added a new dependency (dateutil for its relativedelta implementation) is this ok?
I didn't know this library, if you think it it should be used, feel free to add it :)
Don't forget to use pipenv install <library name>
to update the Pipfile to ensure the lock file is up-to-date.
argparse doesnt allow leading dashes as arguments, because it recognizes them as flags. Does someone have a suggestion for working around this issue?
Can reproduce this too… According to this answer on StackOverflow, you can use either the --date=<offset>
or the -d=<offset>
format instead :)
Is your feature request related to a problem? Please describe. Since version 0.7, the
--day
,--month
and--year
arguments have been removed in the favor of a single, more simple--date
one. But as a side-effect, calculating the ephemerides of the next days is now much more painful, because we now need to give the entire date: before, we could give the --day only for instance, and the month and year were automatically guessed to the current ones.Describe the solution you'd like Add the capacity for the
--date
argument to understand relative dates. The solution I imagine is something inspired from PHP'sDateInterval
constructor, but in a more user-friendly style.The format would follow the following regular expression:
+
or a-
character.d
for days,m
for months,y
for years.Examples of valid intervals:
+1d
(tomorrow)+1m2d
(in one months and two days)+1y2m
(in one year and two months)+1y 2m
(same)Describe alternatives you've considered Currently, the only possible alternative is to give the entire date in the
YYYY-MM-DD
format.