I have multiple instances of a class inside the dom. like the example below.
let element = $(".datepicker-birthdate").pDatepicker({
observer: true,
altField: '.observer-example-alt',
format: 'YYYY/MM/DD',
initialValue: false,
autoClose: true,
calendar:{
'persian': {
'locale': 'fa',
'showHint': false
},
'gregorian': {
'locale': 'en',
'showHint': false
}
},
onSelect: function (date, e){
e: is undefine here also
element: is the last instance of .datepicker-birthdate
}
});
the element always return the last instance of date picker, however i want to access the one that I have changes. Does anyone has a solution around this?