amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.01k forks source link

onSet Callback for highlight events contains the previous highlight #948

Open eggonabull opened 7 years ago

eggonabull commented 7 years ago
var datePicker = dateInput.pickadate({
    onSet: function(e) {
        if(e && e.highlight) {
            console.log(new Date(e.highlight.pick)); // shows previously highlighted date instead of newly highlighted date
        }
    }
}).pickadate('picker');

Open the date picker, then navigate through the months, notice that as you click the month-change arrows, the highlight event logs the date that was previously highlighted, not the newly highlighted event.

burka commented 7 years ago

@amsul Is this a bug or intended?