Repository navigation
Extend report grouping to include Date and Week - #1210
Conversation
|
@TheSpyder Thanks for the PR. It looks very good overall, the only thing that I'd change is the week numbering / formatting logic.
When I saw the special logic for the first week I was looking at what others are doing and from what I can see only Clockify does day grouping in the table right now, and they don't do week numbering in the table at all, they just do Date Ranges, which is a pragmatic approach and also what I'm leaning towards now. I also didn't realize until now that there are different definitions of when the week starts. The ISO definition uses the first day with a Thursday as week one, the US/WEEKNUM definition uses whatever week contains January 1st. The Bar Chart labels already have this issue, but having it in the rows and exports as well could actually cause some serious data problems. There are a few different rules depending on the territory, and we can probably derive them properly at some point (timezone of the user might work but is potentially ambiguous across the organization), or introduce settings (Country on the organization) to do so but that would explode this PR. I think doing a date range is the pragmatic solution for now. It also removes some of the complexity around week formatting in the PR. If you have any thoughts on it feel free to let me know. I can also do the changes myself if you prefer that / are busy. |
|
@Onatcer yes I struggled with this myself, trying to follow the bar chart labels as I think they use the DayJS default weekOfYear plugin. It took quite a bit of tweaking to not use ISO week numbering so I'm quite happy to ditch all that 🙂 I'll see what I can get done today and let you know if I need your help. |
aa31938 to
3bddd49
Compare
|
@Onatcer I've pushed the update - my last commit has been removed entirely, and the week commit is much simpler. |
842bf0b to
2c540be
Compare
|
@TheSpyder awesome ty! |

What does this PR do?
Adds

DateandWeekoptions to the report grouping dropdown. The menu is starting to get a bit long, but I think it's still reasonable:I've updated the frontend, exported reports and shared reports. Screenshots below.
Checklist (DO NOT REMOVE)
Report grouped by date:
Report grouped by week:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.