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 (backport #1345) (#1391)

(cherry picked from commit f52fd55)

Co-authored-by: Akash  Tom <[email protected]>
  • Loading branch information
mergify[bot] and krantheman authored Feb 5, 2024
1 parent cc007a9 commit d202c16
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 d202c16

Please sign in to comment.