Set locale not working
See original GitHub issueI’m submitting a … (check one with “x”)
[ X ] Bug report
[ ] Feature request
[ ] Other, please describe
Tell about your platform
- flatPickr version : 4.5.7
- Vue.js version : 2.0.5
- Browser name and version : Chrome 72.0.3626
- This package version : x.x.x
Current behavior
Importing and setting the locale not working. I’m trying to set the Spanih locale but it dosen’t work
Expected behavior set the flatpickr
import flatpickr from 'flatpickr'
const Spanish = require('flatpickr/dist/l10n/es');
flatpickr.localize(Spanish);
import vueFlatPickr from 'vue-flatpickr-component';
import 'flatpickr/dist/flatpickr.css';
add the config to the elements (tied two different but anyone of the work form me)
customJobHous: {
start: {
time: null,
dateFormat: 'H:i',
wrap: true,
enableTime: true,
enableSeconds: false,
noCalendar: true,
time_24hr: true,
locale: Spanish,
onClose: (selectedDates, dateStr) => {
this.changeTime('start', dateStr);
}
},
end: {
time: null,
dateFormat: 'H:i',
wrap: true,
enableTime: true,
enableSeconds: false,
noCalendar: true,
time_24hr: true,
locale: Spanish,
onClose: (selectedDates, dateStr) => {
this.changeTime('end', dateStr);
this.validJobTemplateHours();
}
}
}
<vue-flat-pickr
class="form-control jobTemplateHour flat-date-picker"
:placeholder="langStartDate"
:config="customJobDate.start"
v-model="form.dateStart"
@on-change="onStartChange"
>
</vue-flat-pickr>
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PHP setlocale has no effect - Stack Overflow
I wanted to translate dates to Spanish, and it was working on my localhost but not in the server (Ubuntu 18). It turned...
Read more >How do I fix my locale issue? - Ask Ubuntu
First run locale to list what locales currently defined for the current user account: $ locale LANG=C LANGUAGE= LC_CTYPE=fi_FI.
Read more >PHP setlocale and strftime Not Working - DevAnswers.co
In this article we will install a new locale using dpkg-reconfigure to resolve problems with PHP setlocale and strftim.
Read more >Problem of Can't set locale; make sure $LC_* and $LANG are ...
Run dpkg-reconfigure locales as root, select the locales you want in the list (with your settings, you need en_GB and en_US.UTF-8 — I...
Read more >setlocale - Manual - PHP
If your system doesn't show any installed locales by "locale -a", try installing them by "dpkg-reconfigure locales" (on debian).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try importing locale like this
https://github.com/ankurk91/vue-flatpickr-component/blob/eeab13f52a5c48e72b063c07b626d6be5bd07fe9/examples/App.vue#L201
Read the doc on how to import locale properly. https://flatpickr.js.org/localization/
Try importing locale like this
vue-flatpickr-component/examples/App.vue
Line 201 in eeab13f
import {Hindi as HindiLocale} from ‘flatpickr/dist/l10n/hi.js’; Read the doc on how to import locale properly. https://flatpickr.js.org/localization/
// right way to import const Russian = require(“flatpickr/dist/l10n/ru.js”).default.ru;
Esta es la manera correcta de hacerlo Gracias @ankurk91