How do I extend a roundup Interval class with new methods?
The existing interval class is a bit of a bother. The default formats
for display are confusing. Is 20:10 20 hours and 10 minutes or 20
minutes and 10 seconds? If it printed all times in hh:mm:ss, like
00:20:10, it would not be ambiguous.
Also if I have a 2d 10h 20m interval, how can I display that as number
of hours and minutes? This would be useful for a timelog to see total
effort expended. Days of effort are rarely done in 24 hour
periods. Usually a day is 8 hours.
I would like to extend the current date.py:Interval: class to add some
more methods, but I am not sure how to go about it. I don't want to
subclass the Interval like:
which would require modifying my schema to use the MyInterval class.
I just want to add new methods to the current Interval so I don't have
to change my schema.
Would adding the following to extensions/interval.py be sufficient?