vue-calendar-heatmap
vue-calendar-heatmap copied to clipboard
Auto detect first day of the week
Used weekstart package to detect sunday or monday as start of the week.
You can check this in recent Chrome. Dev toosl-sensors-location. Change between San Francisco and London.
https://github.com/julienr114/vue-calendar-heatmap/issues/1
I see no changes to the date-squares, does this shift the data to the right place?
I used this example for testing. Put it in project folder and npm run build.
https://gist.github.com/nagos/4e38f883a1e9c90cee0476313e6c6dce
Location set to San Francisco
Location set to London
nice! @julienr114 can this be merged & released?
~~Just chiming in to point out that the weekday
package wasn't updated since a year and it looks like there are shorter methods to get the first day of the week~~ Did a bit more research, looks like this is not that of an easy problem to solve and the link I posted earlier does not solve it.
However, date-fns seems to offer a simple but (more importantly) tree-shakable method which does not introduce 4MB of new dependencies, maybe that'd be better suited?
just my two cents :slightly_smiling_face:
However, date-fns seems to offer a simple but (more importantly) tree-shakable method which does not introduce 4MB of new dependencies, maybe that'd be better suited?
startOfWeek from date-fns gives date of first day of the week (i.e. 21 of december). And you have to provide variable weekStartsOn. We need to know weekStartsOn, so this does not help.
And you have to provide variable weekStartsOn. We need to know weekStartsOn, so this does not help.
I think this is a great lesson for me to not write half thought-through comments on PRs in the middle of the night :)
Sorry for the noise.
Is there any reason for this not to be merged?
Would like to re-iterate this, the PR looks simple enough and there are a lot of places that would benefit from this change.
https://www.timeanddate.com/calendar/days/first-day-of-the-week.html
Upvoting for merge. Is there something blocking PR ?
Just booping this thread, since Gitea is also waiting for this feature to be added: https://github.com/go-gitea/gitea/issues/6058
Just booping this thread, since Gitea is also waiting for this feature to be added: go-gitea/gitea#6058
Gitea uses Vue-3 fork
https://github.com/razorness/vue3-calendar-heatmap/issues/19
My bad, whoops. I hope that people using this component still appreciate the boop ;)