more strict delta parsing
This commit is contained in:
parent
4ccabfc661
commit
a1f58829a6
1
timer.py
1
timer.py
@ -24,6 +24,7 @@ DATETIME_FORMAT = [
|
||||
class DateTime(click.DateTime):
|
||||
def _try_to_convert_date(self, value: t.Any, format: str) -> t.Optional[datetime]:
|
||||
try:
|
||||
if value[0] == "+":
|
||||
if format == DELTASECONDS and value[-1] == "s":
|
||||
return datetime.datetime.now() + datetime.timedelta(
|
||||
seconds=int(value[1:-1])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user