GothenburgBitFactory / timewarrior

Timewarrior - Commandline Time Tracking and Reporting
https://timewarrior.net
MIT License
1.25k stars 94 forks source link

using week numbers accounts Sunday through Saturday, not Monday through Sunday #595

Closed smemsh closed 2 weeks ago

smemsh commented 6 months ago

Week numbers would typically be ISO weeks, but they seem to include the Sunday from the previous week, and not include the Sunday from the given week. For example:

timew summary 2024-W10 - 2024-W11

includes Sunday from W9 and does not include Sunday from W10. This differs from [imo correct] behavior of :week and :lastweek which use Monday based weeks. I would think week number would correspond exactly to date +%V.

This was tested with timew-1.7.1 and its pegged libshared.

Got the week syntax from src/libshared/test/datetime.t.cpp. Was not sure if the bug should be filed in libshared repo, but it seems to be library-user-specific since :week and :lastweek are working as expected, but let me know if this should be moved there.