More tidy.
This commit is contained in:
parent
569935a5e6
commit
2c3805e4b0
1 changed files with 1 additions and 2 deletions
|
@ -79,8 +79,7 @@ def build_parser():
|
|||
if s == "today":
|
||||
return today()
|
||||
try:
|
||||
datetime.strptime(s, "%Y-%m-%d")
|
||||
return s
|
||||
return datetime.strptime(s, "%Y-%m-%d").date().isoformat()
|
||||
except ValueError:
|
||||
msg = f"Not a valid YYYY-MM-DD date: '{s}'."
|
||||
raise argparse.ArgumentTypeError(msg)
|
||||
|
|
Loading…
Add table
Reference in a new issue