Skip to content

Commit

Permalink
Fix datetimes (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
esebesto authored Feb 12, 2024
1 parent 5c0b534 commit 6595d0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "4.4.13"
__version__ = "4.4.14"

VERSION = __version__.split(".")
4 changes: 4 additions & 0 deletions nise/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ def calculate_start_date(start_date):
generated_start_date = today().replace(day=1, hour=0, minute=0, second=0) + relativedelta(months=-1)
elif start_date == "today":
generated_start_date = today().replace(hour=0, minute=0, second=0)
elif start_date and isinstance(start_date, datetime.datetime):
generated_start_date = start_date
elif start_date and isinstance(start_date, datetime.date):
generated_start_date = datetime.datetime(start_date.year, start_date.month, start_date.day)
elif start_date:
Expand All @@ -759,6 +761,8 @@ def calculate_end_date(start_date, end_date):
generated_end_date = today().replace(day=1, hour=0, minute=0, second=0) + relativedelta(months=-1)
elif end_date == "today":
generated_end_date = today().replace(hour=0, minute=0, second=0)
elif end_date and isinstance(end_date, datetime.datetime):
generated_end_date = end_date
elif end_date and isinstance(end_date, datetime.date):
generated_end_date = datetime.datetime(end_date.year, end_date.month, end_date.day)
else:
Expand Down

0 comments on commit 6595d0a

Please sign in to comment.