Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix datetimes #484

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading