Tweak how empty hours are displayed in time sheet

This commit is contained in:
Lance Edgar 2016-05-02 18:24:09 -05:00
parent 77ce81dec0
commit be7108bcda

View file

@ -81,13 +81,13 @@ class TimeSheetView(View):
else: else:
break break
empday['hours_display'] = '' empday['hours_display'] = '0'
if empday['hours']: if empday['hours']:
minutes = (empday['hours'].days * 1440) + (empday['hours'].seconds / 60) minutes = (empday['hours'].days * 1440) + (empday['hours'].seconds / 60)
empday['hours_display'] = '{}:{:02d}'.format(minutes // 60, minutes % 60) empday['hours_display'] = '{}:{:02d}'.format(minutes // 60, minutes % 60)
employee.weekdays.append(empday) employee.weekdays.append(empday)
employee.hours_display = '' employee.hours_display = '0'
if employee.hours: if employee.hours:
minutes = (employee.hours.days * 1440) + (employee.hours.seconds / 60) minutes = (employee.hours.days * 1440) + (employee.hours.seconds / 60)
employee.hours_display = '{}:{:02d}'.format(minutes // 60, minutes % 60) employee.hours_display = '{}:{:02d}'.format(minutes // 60, minutes % 60)