chrisdavies / tiny-date-picker

A small, modern, dependency-free date picker
https://chrisdavies.github.io/tiny-date-picker/
415 stars 87 forks source link

store input element in DatePicker instance #106

Closed luizbills closed 2 years ago

ebrensi commented 4 years ago

@luizbills this is why I'm here too. If I instantiate two TinyDatePickers via a class selector like

const datePicker = TinyDatePicker(".datepick", {
      mode: 'dp-below',
});

and attach a listener

 datePicker.on("statechange", (e, picker) => {
     const state = picker.state,
              date = state.selectedDate;
     // I need to know which of two datepickers I am getting called from.
 });

Is there already a way to do this?