Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto detect first day of the week #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nagos
Copy link

@nagos nagos commented Sep 9, 2020

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.

#1

Used weekstart package to detect sunday or monday as start of the week.
@noerw
Copy link

noerw commented Dec 22, 2020

I see no changes to the date-squares, does this shift the data to the right place?

@nagos
Copy link
Author

nagos commented Dec 22, 2020

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
san-francisco

Location set to London
london

@noerw
Copy link

noerw commented Dec 22, 2020

nice!
@julienr114 can this be merged & released?

@kolaente
Copy link

kolaente commented Dec 24, 2020

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 🙂

@nagos
Copy link
Author

nagos commented Dec 24, 2020

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.

@kolaente
Copy link

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.

@E1k3
Copy link

E1k3 commented Jul 19, 2022

Is there any reason for this not to be merged?

@bendem
Copy link

bendem commented Mar 14, 2023

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

@KazzmanK
Copy link

KazzmanK commented May 7, 2023

Upvoting for merge. Is there something blocking PR ?

@jjbankert
Copy link

Just booping this thread, since Gitea is also waiting for this feature to be added: go-gitea/gitea#6058

@KazzmanK
Copy link

Just booping this thread, since Gitea is also waiting for this feature to be added: go-gitea/gitea#6058

Gitea uses Vue-3 fork

razorness#19

@jjbankert
Copy link

My bad, whoops. I hope that people using this component still appreciate the boop ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants