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)