ng2-flatpickr
ng2-flatpickr copied to clipboard
How to update locale on Locale change
Using redux and change locale should update all the labels etc. Only thing that isn't updated is the flatpickr config while it is changed in the ngonchange. Any ideas?
Please post a reproduction of the issue so I can take a look - so far I have not encountered this problem.
I've downloaded your code and added this in the onChange
ngOnChanges(changes: SimpleChanges): void {
if (changes.hasOwnProperty('setDate') && changes['setDate'].currentValue ) {
this.setDateFromInput( changes[ 'setDate' ].currentValue );
}
if (changes.hasOwnProperty('config') && changes.config.currentValue !== changes.config.previousValue) {
Object.assign( this.defaultFlatpickrOptions, changes.config.currentValue );
this.flatpickr = this.flatpickrElement.nativeElement.flatpickr( this.defaultFlatpickrOptions );
}
}