diff --git a/Pipfile b/Pipfile index 89e84bb..a28f981 100644 --- a/Pipfile +++ b/Pipfile @@ -16,7 +16,7 @@ tabulate = "*" numpy = ">=1.17.0,<2.0.0" termcolor = "*" latex = "*" -dateutil = ">=2.8.1" +dateutil = "*" [requires] python_version = "3" diff --git a/kosmorrolib/main.py b/kosmorrolib/main.py index 41c7b38..26e2b97 100644 --- a/kosmorrolib/main.py +++ b/kosmorrolib/main.py @@ -109,7 +109,7 @@ def get_date(date_arg: str) -> date: elif re.match(r'^([+-])(([0-9]+)y)?[ ]?(([0-9]+)m)?[ ]?(([0-9]+)d)?$', date_arg): def get_offset(date_arg: str, signifier: str): if re.search(r'([0-9]+)' + signifier, date_arg): - return int(re.search(r'[+-]?([0-9]+)' + signifier, date_arg).group(0)[:-1]) + return abs(int(re.search(r'[+-]?([0-9]+)' + signifier, date_arg).group(0)[:-1])) else: return 0 @@ -124,7 +124,7 @@ def get_date(date_arg: str) -> date: return date.today() - relativedelta(days=days, months=months, years=years) else: - raise ValueError(_('The date {date} does not match the required YYYY-MM-DD format or the offset format.').format(date=date_arg)) + raise ValueError(_('The date {date} does not match the YYYY-MM-DD format or the relativedate format.').format(date=date_arg)) diff --git a/manpage/kosmorro.1.md b/manpage/kosmorro.1.md index 08f4170..08a23d2 100644 --- a/manpage/kosmorro.1.md +++ b/manpage/kosmorro.1.md @@ -23,7 +23,7 @@ the observer's longitude on Earth `--date=`_DATE_, `-d` _DATE_ - The date for which the ephemerides must be computed (in the YYYY-MM-DD format); defaults to the current date + The date for which the ephemerides must be computed, either in in the YYYY-MM-DD format or as an interval formatted like [+-]YyMmDd; defaults to the current date `--timezone=`_TIMEZONE_, `-t` _TIMEZONE_ the timezone to display the hours in; e.g. 2 for UTC+2 or -3 for UTC-3