Use pretty_hours()
function where applicable
This commit is contained in:
parent
ca4d15f06c
commit
43a3b8ae0a
|
@ -33,6 +33,7 @@ import sqlalchemy as sa
|
|||
from rattail import enum
|
||||
from rattail.db import model, api
|
||||
from rattail.time import localtime, make_utc, get_sunday
|
||||
from rattail.util import pretty_hours
|
||||
|
||||
import formencode as fe
|
||||
from pyramid_simpleform import Form
|
||||
|
@ -396,15 +397,13 @@ class TimeSheetView(View):
|
|||
|
||||
hours = empday['{}_hours'.format(shift_type)]
|
||||
if hours:
|
||||
minutes = (hours.days * 1440) + (hours.seconds / 60)
|
||||
empday['{}_hours_display'.format(shift_type)] = '{}:{:02d}'.format(minutes // 60, minutes % 60)
|
||||
empday['{}_hours_display'.format(shift_type)] = pretty_hours(hours)
|
||||
employee.weekdays[i].update(empday)
|
||||
|
||||
hours = getattr(employee, '{}_hours'.format(shift_type))
|
||||
if hours:
|
||||
minutes = (hours.days * 1440) + (hours.seconds / 60)
|
||||
setattr(employee, '{}_hours_display'.format(shift_type),
|
||||
'{}:{:02d}'.format(minutes // 60, minutes % 60))
|
||||
pretty_hours(hours))
|
||||
|
||||
@classmethod
|
||||
def defaults(cls, config):
|
||||
|
|
Loading…
Reference in a new issue