-
Notifications
You must be signed in to change notification settings - Fork 102
Changing the config.locale
option doesn't update the locale used
#77
Comments
@renzo-s |
Not at the moment, but the setup is simple <template>
<flat-pickr config="config" />
</template>
<script>
import { Dutch } from 'flatpickr/dist/l10n/nl.js'
import { english } from 'flatpickr/dist/l10n/default.js'
const langs = {
en: english,
nl: Object.assign({}, english, Dutch)
}
// ... vue inst with the data
methods() {
setNL() {
this.config.locale = langs['nl']
}
setEN() {
this.config.locale = langs['en']
}
}
</script> And trigger the methods with a button or something |
Ok, i will check. |
Quick fix we opted for was moving the
This is quick and dirty but seems like the only way to also update the input value with the correct Hope this can be a nice enhancement in the future, or some help for others trying to implement l10n switching. Thanks for the quick replies |
@renzo-s |
😄even better. Have not investigated the lib enough to open a ticket though |
Flatpickr does support changing locale dynamically. We need to figure out a way to implement in this vue component. flatpickrInstance.set('locale', importedLocaleObjectGoesHere) |
@renzo-s |
Fixed in v7.0.2 |
I'm submitting a ...
Tell about your platform
Current behavior
Changing the
config.locale
option doesn't update the locale used in the config watcher.I have got it to work with adding the following after
this.fp.set(safeConfig)
:The text was updated successfully, but these errors were encountered: