mirror of
https://github.com/mlesniew/elicznik.git
synced 2025-12-25 22:53:33 +01:00
Accept dates in ISO format only
This commit is contained in:
@@ -23,7 +23,7 @@ optional arguments:
|
||||
|
||||
Example
|
||||
```
|
||||
$ elicznik freddy@example.com secretpassword 10.7.2021
|
||||
$ elicznik freddy@example.com secretpassword 2021-07-10
|
||||
timestamp consumed produced
|
||||
------------------- ---------- ----------
|
||||
2021-07-03 01:00:00 0.116 0
|
||||
|
||||
@@ -22,7 +22,7 @@ def main():
|
||||
parser.add_argument(
|
||||
"date",
|
||||
nargs="?",
|
||||
type=lambda arg: datetime.datetime.strptime(arg, "%d.%m.%Y").date(),
|
||||
type=datetime.date.fromisoformat,
|
||||
default=datetime.date.today() - datetime.timedelta(days=1),
|
||||
help="Date of data to be retrieved",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user