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

[Question] Can I change my week selection from monday to saturday #47

Open
minhchau2605 opened this issue Jun 13, 2023 · 2 comments
Open

Comments

@minhchau2605
Copy link

minhchau2605 commented Jun 13, 2023

Vue-datepicker-next version: 1.0.3
Vue version: 3.2.45
Browser: Chrome 114.0.5735.110

Can I change my week selection from monday to saturday. Default is from sunday to saturday ?

@goshku
Copy link

goshku commented Sep 20, 2023

Vue-datepicker-next version: 1.0.3 Vue version: 3.2.45 Browser: Chrome 114.0.5735.110

Can I change my week selection from monday to saturday. Default is from sunday to saturday ?

Use

      formatLocale: {
        firstDayOfWeek: 1,
      },

@deevanych
Copy link

deevanych commented Nov 2, 2023

Vue-datepicker-next version: 1.0.3 Vue version: 3.2.45 Browser: Chrome 114.0.5735.110

Can I change my week selection from monday to saturday. Default is from sunday to saturday ?

Hey! I found solution. @goshku is wrong.

You need use code below:

const currentLocale = useI18n().locale.value // or 'en' hardcode, eg.
const datePickerLocale = DatePicker.locale(currentLocale)
datePickerLocale.formatLocale.firstDayOfWeek = 1

DatePicker.locale(currentLocale, datePickerLocale)

and use Datepicker as usual in your code 😉

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

No branches or pull requests

3 participants