[#94] Store deltas inseconds instead of parsing to minutes
Created by: ghost
Activity delta (duration) are received from dbus in a seconds format, instead to parsing them to minutes then compiling them to make the today-summary. We keep them in seconds all the time for more precision.
The time formatting functions have also been rewrite to use seconds instead minutes and to have a cleaner approach using Date() objects and round().
Closes: #94 (closed)
Merge request reports
Activity
Created by: elbenfreund
I think the general idea and impetus of this PR is correct. However, Using
Date
is suboptimal itself. Whilst unlikely it will for sure fail for facts that last longer than 24 hours. But even without that, it would be just a different kind of hackish solution that disguises the simple fact that javascript lacks a decent way to handle timedeltas entirely, like so many things.Instead of pretending otherwise we should focus of cleaning up the formating functions as they are and make their use as transparent as possible. One thing that I agree with entirely is abandoning the unwarranted conversion to minutes when retrieving the dbus fact.
In total, I will close this PR in favour of the alternative #201 I hope that is alright with you.