After trying to implement the js-datepicker plugin from https://www.npmjs.com/package/js-datepicker, I ran into an issue. I have multiple input fields in which I want to use the same date picker, so I assigned them all the class 'year'. Unfortunately, the date picker only applies to the first input field with that class. Is there a way to make it work for all inputs with that class?
Here is the snippet of my code:
const year = datepicker('.year', {
/* formatter: (input, date, instance) => {
const value = date.toLocaleDateString()
input.value = value // => '1/1/2099'
}*/
});