From 2c3805e4b09b586f99b84052acda7004cea480ae Mon Sep 17 00:00:00 2001 From: Chris Berkhout Date: Fri, 28 May 2021 22:27:17 +0200 Subject: [PATCH] More tidy. --- src/pricehist/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pricehist/cli.py b/src/pricehist/cli.py index a057072..1ae3d6a 100644 --- a/src/pricehist/cli.py +++ b/src/pricehist/cli.py @@ -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)