Changeset 64e8299 in OpenWorkouts-current for ow


Ignore:
Timestamp:
Jan 7, 2019, 12:45:28 PM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
e3d7b13
Parents:
fe6089a
Message:

Show properly formatted duration for workouts (hours:minutes:seconds)

even for workouts which duration contains microseconds info.

Location:
ow
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ow/models/workout.py

    rfe6089a r64e8299  
    113113
    114114    @property
     115    def _duration(self):
     116        return ':'.join(
     117            [self.duration_hours, self.duration_minutes, self.duration_seconds]
     118        )
     119
     120    @property
    115121    def rounded_distance(self):
    116122        """
  • ow/templates/dashboard.pt

    rfe6089a r64e8299  
    4141              </li>
    4242              <li>
    43                 <tal:c tal:content="workout.duration"></tal:c>
     43                <!--! use the properly formatted duration instead of the timedelta object -->
     44                <tal:c tal:content="workout._duration"></tal:c>
    4445              </li>
    4546              <li tal:condition="workout.distance">
  • ow/templates/workout.pt

    rfe6089a r64e8299  
    8989        <li>
    9090          <tal:t i18n:translate="">Duration:</tal:t>
    91           <tal:c tal:content="context.duration"></tal:c>
     91          <!--! use the properly formatted duration instead of the timedelta object -->
     92          <tal:c tal:content="context._duration"></tal:c>
    9293        </li>
    9394        <li tal:condition="context.distance">
Note: See TracChangeset for help on using the changeset viewer.