Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74810

get_time_interval_string() improvements

XMLWordPrintable

    • 1
    • Team Hedgehog 2023 Sprint 3.1
    • Small

      The get_time_interval_string() is a good utility function for displaying time duration between timestamps. However, I think we can further improve on this by adding the following options:

      1. Allow dropping zero units.
        • If the format is not supplied, the format defaults to "dateintervaldayshoursmins" with a format of "%ad %hh %im". Let's say that we have an interval of 3 days, the function will return "3d 0h 0s". It would look simpler if we can drop the zero-time units.
      2. Allow the option to display full format for time units
        • If format is not supplied, provide the option to display the time units in full format. E.g. instead of returning "3d", we can return "3 days" instead.

            jpataleta Jun Pataleta
            jpataleta Jun Pataleta
            Safat Shahin Safat Shahin
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 40 minutes
                4h 40m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.