balbarak / bootstrap-hijri-datepicker

Bootstrap Hijri Date picker
MIT License
56 stars 53 forks source link

On change event #6

Closed Umarali33 closed 4 years ago

Umarali33 commented 4 years ago

How can I pick on change event? I try lots of methods but nothing worked. jQuery("#CaseHijriDate)").hijriDatePicker({ locale: "ar-sa", format: 'mm/dd/yyyy', hijri: true, hijriFormat: 'iMM/iDD/iYYYY', showSwitcher: false, allowInputToggle: false, showTodayButton: true, useCurrent: true, isRTL: false, keepOpen: false, showClear: true, showClose: false }).change(function () { alert('test'); }); i also try below code but not succes jQuery('#CaseHijriDate)').change(function () { alert('test'); }); also please mention all events which is working.

balbarak commented 4 years ago

in order to catch change event use the followings


$("#CaseHijriDate").on('dp.change', function (event) {
            console.log(event.date)
});

other events

we should add this in the documentations

Thanks

Umarali33 commented 4 years ago

Thanks it's worked.

Nadirdasti commented 4 years ago

$("#CaseHijriDate").on('dp.change', function (event) { console.log(event.date) }); its return georgian date.i want selected date should be in hijri format.

balbarak commented 4 years ago

You can try

$(this).data('date');

Thanks