ng2-flatpickr icon indicating copy to clipboard operation
ng2-flatpickr copied to clipboard

How to update locale on Locale change

Open rickvandermey opened this issue 6 years ago • 2 comments

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?

rickvandermey avatar Apr 04 '18 11:04 rickvandermey

Please post a reproduction of the issue so I can take a look - so far I have not encountered this problem.

mezoistvan avatar Apr 05 '18 21:04 mezoistvan

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 );
		}
	}

rickvandermey avatar Apr 06 '18 10:04 rickvandermey