Skip to content

Commit

Permalink
fix(Shift Attendance): conversion of datetime to time for same date f…
Browse files Browse the repository at this point in the history
…or None values
  • Loading branch information
krantheman committed Jan 22, 2024
1 parent f7c8f64 commit 39b4b94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hrms/hr/report/shift_attendance/shift_attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ def format_in_out_time(in_time, out_time, attendance_date):
in_time = in_time.time()
elif out_time and not in_time and out_time.date() == attendance_date:
out_time = out_time.time()
elif in_time and out_time:
else:
in_time, out_time = convert_datetime_to_time_for_same_date(in_time, out_time)
return in_time, out_time


def convert_datetime_to_time_for_same_date(start, end):
if start.date() == end.date():
if start and end and start.date() == end.date():
start = start.time()
end = end.time()
else:
Expand Down

0 comments on commit 39b4b94

Please sign in to comment.