flatpickr
flatpickr copied to clipboard
Load config dynamicly
Is there a way to create configs, assign them to a var and load them dynamicly ?
import flatpickr from "flatpickr";
// Override Global settings
flatpickr.setDefaults({
disableMobile: true
});
You can also modify configs for a specific input field.
instanceVariable.set(configObject)
This should be in docs already
Yup it's documented here. This issue can be closed.
Unfortunately the instance#set cannot be used to dynamically enable or disable the timepicker.
console.log(fp.config.enableTime) // false
fp.set('enableTime', true)
console.log(fp.config.enableTime) // true
It dose so in the code, but the DOM dose not re-render. Please have a look at https://jsfiddle.net/fg7pk5ec/15/