Changeset 75:957d4b9c06eb in stamper
- Timestamp:
- Feb 24, 2020, 8:27:01 AM (5 years ago)
- Branch:
- default
- Phase:
- public
- Tags:
- tip
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stamper/stamper.py
r74 r75 11 11 from .config import Config 12 12 from .filters import DateFilter 13 14 15 def timedelta_to_hms(value): 16 """ 17 Return hours, minutes, seconds from a timedelta object 18 """ 19 hours, remainder = divmod(int(value.total_seconds()), 3600) 20 minutes, seconds = divmod(remainder, 60) 21 return hours, minutes, seconds 13 22 14 23 … … 299 308 seconds=totals.get(customer, 0) 300 309 total = timedelta(seconds=totals.get(customer, 0)) 310 h, m, s = timedelta_to_hms(total) 311 total = ':'.join( 312 [str(h).zfill(2), str(m).zfill(2), str(s).zfill(2)]) 301 313 if not self.wants_seconds or self.wants_seconds == 'false': 302 314 # remove the seconds part from the string representation … … 308 320 seconds=totals[c] 309 321 total = timedelta(seconds=totals[c]) 322 h, m, s = timedelta_to_hms(total) 323 total = ':'.join( 324 [str(h).zfill(2), str(m).zfill(2), str(s).zfill(2)]) 310 325 if not self.wants_seconds or self.wants_seconds == 'false': 311 326 # remove the seconds part from the string representation
Note:
See TracChangeset
for help on using the changeset viewer.