Fixing a bug to differentiate between 23:59:59 and 24:00:00 end times

This commit is contained in:
Sam Splunks
2024-03-27 14:19:15 +00:00
parent cf81e0d452
commit f4bde19511
2 changed files with 11 additions and 7 deletions

View File

@@ -994,7 +994,7 @@ class FollowUp(models.Model):
if helpdesk_settings.FOLLOWUP_TIME_SPENT_AUTO and not self.time_spent:
self.time_spent = self.time_spent_calculation()
super(FollowUp, self).save(*args, **kwargs)
def get_markdown(self):
@@ -1045,14 +1045,14 @@ class FollowUp(models.Model):
# close single day case
end_day_time = latest
else:
end_day_time = earliest.replace(hour=23, minute=59, second=59)
end_day_time = earliest.replace(hour=23, minute=59, second=59, microsecond=999999)
elif day == days:
start_day_time = latest.replace(hour=0, minute=0, second=0)
end_day_time = latest
else:
middle_day_time = earliest + datetime.timedelta(days=day)
start_day_time = middle_day_time.replace(hour=0, minute=0, second=0)
end_day_time = middle_day_time.replace(hour=23, minute=59, second=59)
end_day_time = middle_day_time.replace(hour=23, minute=59, second=59, microsecond=999999)
if (start_day_time.strftime("%Y-%m-%d") not in holidays and
prev_status not in exclude_statuses and