-
Notifications
You must be signed in to change notification settings - Fork 840
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
locale documentation #101
Comments
Same issue, how can i change locale? |
Locale can be set up one of two ways.
import Vue from 'vue';
import VCalendar from 'v-calendar';
Vue.use(VCalendar, {
locale: 'es' // Spanish
});
As of now, the reason it is not documented is because I see little benefit to forcing all users to use one specific locale. The only downside to this approach is if you need a locale that is not supported out of the box. See the list for reference. If that is the case, I would need to add support for passing in a custom locale object. |
@nathanreyes How can I change locale if I use the calendar from CDN? |
Currently, there is no way to force a locale via CDN. However, it still does try and detect the locale automatically. Is there a specific locale you had in mind that needed to be supported? |
@nathanreyes I need ukrainian, if you can't add this language, how can i customize calendar?. |
@niksib you can do a little hack like below. You can pass any options and reinstall any plugin which not available on global scope.
|
@EricMcRay Thanks, but the calendar doesn't support the Ukrainian language. |
@EricMcRay when I use your little hack and set weekends(Saturday, Sunday)
|
@niksib What version of the plugin are you currently using? |
@nathanreyes Sorry it's my fail, I had to put this: weekdays: [1, 7] |
@niksib Yes, I was about to post that :) |
To resolve this issue, a bug will get fixed that will support all locales supported by Also, the docs site will more elaborately explain how locales are resolved. |
Resolved by 19b8d6f. |
I really appreciate you work on v-calendar but I have a silly question - how can I update locales during application lifetime? I'm setting locales during installation, like below: import Vue from 'vue';
import VCalendar from 'v-calendar';
Vue.use(VCalendar, {
locale: 'pl-PL'
}); ..and wondering how can I change above locale in component's method etc. Is there any workaround? |
I have the same problem as @achwilko Thanks! |
@lgomes2m having the same trouble, did you find any solution for that? |
@hisenbergguj At template I put a key at v-date-picker: `<v-date-picker
And currentLanguage is a computed var: `computed: {
}` When you call setupCalendar() it didn't re render vcalendar but it actually change its locale, I am using currentLanguage as a key because when it changes it forces de component to render again and now it will use the correct language. @Chemahin gave another solution here but I didn't test it yet. I hope it helps you. |
@lgomes2m I have tried your solution but it gives me "setupCalendar" is not defined". do you have any idea, what am I doing wrong here? |
I do not remember exactly. But you have to connect this part in main.js
file...Vue.use(VCalendar, {
firstDayOfWeek: 1,
locale:'nl-NL',
datePickerTintColor: "#00c7d6",
datePickerShowDayPopover: false,
weekdays: 'WW',
});
пт, 21 сент. 2018 г. в 8:32, hisenbergguj <notifications@github.com>:
… @lgomes2m <https://github.com/lgomes2m> I have tried your solution but it
gives me "setupCalendar" is not defined".
I have already import it like this : import VCalendar, {setupCalendar}
from 'v-calendar';
do you have any idea, what am I doing wrong here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#101 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVSocAbtF5ExCVLusQ5y4oygaMeeNTF0ks5udHoIgaJpZM4S4dAj>
.
|
Sorry.... I don't know why... And in main.js:
|
try to do this:
пт, 21 сент. 2018 г. в 15:41, lgomes2m <notifications@github.com>:
… @hisenbergguj <https://github.com/hisenbergguj>
Sorry.... I don't know why...
I am importing like this:
import { setupCalendar, Calendar } from 'v-calendar'
And in main.js:
`
import VCalendar from 'v-calendar'
Vue.use(VCalendar)
`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#101 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVSocPvihAW9ib7xDOFMrOHNNrvzelysks5udN5kgaJpZM4S4dAj>
.
|
try to do this:
in main.js
import Vue from 'vue';import VCalendar from 'v-calendar';import
'v-calendar/lib/v-calendar.min.css';
Vue.use(VCalendar, {
firstDayOfWeek: 1,
locale:'nl-NL',
datePickerTintColor: "#00c7d6",
datePickerShowDayPopover: false,
weekdays: 'WW',
});
in your component :
<v-calendar
</v-calendar>
пт, 21 сент. 2018 г. в 15:41, lgomes2m <notifications@github.com>:
… @hisenbergguj <https://github.com/hisenbergguj>
Sorry.... I don't know why...
I am importing like this:
import { setupCalendar, Calendar } from 'v-calendar'
And in main.js:
`
import VCalendar from 'v-calendar'
Vue.use(VCalendar)
`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#101 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVSocPvihAW9ib7xDOFMrOHNNrvzelysks5udN5kgaJpZM4S4dAj>
.
|
Hey @nathanreyes, thank you very much for your work on this amazing calendar! I have one request... Could you add support for Slovenian locale (sl-SI)? It has the same date format as Croatian. Thank you! |
I want to set custom locale all my date-pickers across my project but it isn't working. It's kinda only available if I set locale attribute on all my date-pickers one by one. How could I set locale default in Vue.use or something. Vue.use(VCalendar, {
componentPrefix: 'v',
locale: 'mn-MN',
locales: {
'mn-MN': {
firstDayOfWeek: 2,
masks: {
L: "YYYY-MM-DD",
}
}
}
}); but it won't make any changes <v-date-picker v-model="filters.from" :input-props="{ placeholder: $t('startDate') }" locale="mn-MN" class="form-control date"/> if I set my locale on every use I could use my declared locale without problem show as like above. |
I'm from Mexico, so I needed to display the weekdays in spanish, so I used this code:
But as this translate to spanish weekday names in lowercase I had to add a css rule (this is up to you) to capitalize the weekday to something like "Lunes" and not "lunes" like this:
Cheers |
Hello, can you please add kk-KZ locale nathanreyes |
i second @AlmasF. can you add kk-KZ please |
Looks like
locale
options is not documented. I don't see it in the props listThe text was updated successfully, but these errors were encountered: