-
Improvement
-
Resolution: Fixed
-
Minor
-
4.1
-
MOODLE_401_STABLE
-
MOODLE_403_STABLE
-
MDL-74810-master -
-
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:
- 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.
- 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.