diff --git a/README.md b/README.md index 3579afb..2cd7c96 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,9 @@ $("#input1")persianDatePicker({ onHide: function(calendar) { calendar.hide(); }, + onSelect: function() { + // do on select, can be used instead of jquery .change() + }, }); ``` diff --git a/js/persianDatepicker.js b/js/persianDatepicker.js index dc6f333..34fa56c 100644 --- a/js/persianDatepicker.js +++ b/js/persianDatepicker.js @@ -399,7 +399,7 @@ } else { el.html(self.persianDate.parse(v).toString(self.options.formatDate)); } - el.data('date', { jDate: v, gDate: this.jDateFunctions.getGDate(this.persianDate)._toString("YYYY/MM/DD/DW") }); + el.data('date', { jDate: self.persianDate.parse(v).toString(self.options.formatDate), gDate:self.persianDate.parse(v).gDate._toString(self.options.formatDate)}); this.options.onSelect(); }, getDate: function (jd, d) {