Skip to content

Commit

Permalink
tune start date search in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetretto committed Sep 18, 2023
1 parent 7bcd12e commit c77029c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/jobflow_remote/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ def get_start_date(start_date: datetime | None, days: int | None, hours: int | N
):
now = datetime.now()
start_date = start_date.replace(year=now.year, month=now.month, day=now.day)
if start_date > now:
start_date = start_date - timedelta(days=1)
elif days:
start_date = datetime.now() - timedelta(days=days)
elif hours:
Expand Down

0 comments on commit c77029c

Please sign in to comment.