lordi / tickmate

One bit journal
GNU General Public License v3.0
111 stars 34 forks source link

Bugfix break / streak calculation around DST change dates #113

Closed StefRe closed 7 years ago

StefRe commented 7 years ago

Due to daylight saving time (DST), there is one day with 23 hours and one with 25 hours once a year. This leads to incorrect results when calculation the number of days by just dividing the millis difference by 24 hours. Example (German time zone): one tick on 24 Mar 17 and one on 27 Mar 17 gave a break of 1 day instead of 2; one tick on 26 Mar 17 and one on 27 Mar 17 gave a streak of 1 instead of 2. This bugfix corrects the breaks / streaks calculation for time spans including the DST change moment.

lordi commented 7 years ago

Nice, I will release a new version as soon as I find the time