the previous implementation had a bug where diffSec was always added to the difference when sometimes it would have to be subtracted. for example assume a time of 0:59 and a constraint at 1:00. the previous implementation would calculate a diff of 61 sec when the expected result is 1 sec.
therefore I propose this refactoring based on representing both values as seconds which also fixes the aforementioned bug.
the previous implementation had a bug where diffSec was always added to the difference when sometimes it would have to be subtracted. for example assume a time of 0:59 and a constraint at 1:00. the previous implementation would calculate a diff of 61 sec when the expected result is 1 sec. therefore I propose this refactoring based on representing both values as seconds which also fixes the aforementioned bug.