Skip to content

Conversation

@ChronosMasterOfAllTime
Copy link
Contributor

@ChronosMasterOfAllTime ChronosMasterOfAllTime commented Nov 17, 2025

Describe your changes

Added a weekday enum to pass into the Vue date picker prop instead of a non-descript int/string (0-6).

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have ensured that unit tests pass without errors
  • If it is a new feature, I have added a new unit test
image

@Faq
Copy link

Faq commented Nov 18, 2025

I'd say better to use config to set start of the week Monday or Sunday

@ChronosMasterOfAllTime
Copy link
Contributor Author

I'd say better to use config to set start of the week Monday or Sunday

Not sure what you mean. Can you please elaborate @Faq ?

@Faq
Copy link

Faq commented Nov 18, 2025

I mean this should be configurable option, where let's say by default week starts at Monday, but with configuration can set that it starts at Sunday.

@Jasenkoo
Copy link
Contributor

It is a personal preference, introducing this change is a breaking change. Also, changing starting day is easy with passing week-start prop

@Jasenkoo Jasenkoo closed this Nov 18, 2025
@ChronosMasterOfAllTime
Copy link
Contributor Author

ChronosMasterOfAllTime commented Nov 18, 2025

@Jasenkoo not sure why this was closed. This commit changed the behavior of the calendar to Mon-Sun since weekStart is default 1. Your original code had the days indexed [1,2,3,4,5,6,7] => sun-sat

This PR was to reset and introduce a friendly enum type and go back to the original default start. I verified it locally by running back through the commit history.

Before a32ba3f
image

After a32ba3f
image

With this PR:
image

Plus you can use the enum values to more reliably manipulate the week start and it's non-breaking to existing users. With commit a32ba3f every instance of vue-datepicker I have to now set :week-start="0" <-- this doesn't translate well for DevX.

See Schedule-x for example. They use an enum for setting the first day of the week.

@Jasenkoo
Copy link
Contributor

I am willing to accept the PR, but with applied changes from review

@Jasenkoo Jasenkoo reopened this Nov 18, 2025
@ChronosMasterOfAllTime
Copy link
Contributor Author

Will push the changes once GitHub comes back:

image

@ChronosMasterOfAllTime
Copy link
Contributor Author

I am willing to accept the PR, but with applied changes from review

Resolved

@ChronosMasterOfAllTime ChronosMasterOfAllTime changed the title Default to Sunday as first day of the week and use enums Use Enums for WeekStart Nov 18, 2025
@Jasenkoo Jasenkoo merged commit b077874 into Vuepic:main Nov 19, 2025
1 check passed
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.

3 participants