B
B
Breeze12020-05-21 16:41:34
JavaScript
Breeze1, 2020-05-21 16:41:34

How to synchronize two air datepicker?

I use air datepicker as a calendar.

There are 2 calendars on the page, they need to be synchronized somehow - we select the date on one, the second one is selected automatically.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-09-05
@Breeze1

When selecting a date on one picker, set the other to an array of selected dates, and force it to redraw:

onSelect(formattedDate, date) {
  anotherPicker.selectedDates = [ date ];
  anotherPicker.update();
},

https://jsfiddle.net/h6zLrygd/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question