pheroMona13 / kamaDatepicker

A jQuery based datepicker for jalali (shamsi) calendar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

events not working on datepicker input

mahdisoftdev opened this issue · comments

commented

hellow,i want to run some event on datepicker field with addEventListener in js but it dosent work,how can I run some event after the date changing?

commented

Add your event listeners to the input which you assign the datepicker to. There should not be any problem, if you still had issues send me your snippet so I can investigate it further.

commented

here is my code

`

<script src="assets/libs/persian-datepicker/kamadatepicker.min.css"></script>

input type text with jobReserveDate id

<script src="assets/libs/persian-datepicker/jquery.min.js"></script> <script src="assets/libs/persian-datepicker/kamadatepicker.min.js"></script> <script src="assets/js/app.js"></script>

`

and in app.js file i have:

`
const jobReserveDate = document.getElementById('jobReserveDate');
if(jobReserveDate !== null){
jobReserveDate.addEventListener('change' , function(){
alert("change");
}, false);
}

kamaDatepicker('jobReserveDate',
{ buttonsColor: "red",
markToday: true,
markHolidays: true,
twodigit:true,
forceFarsiDigits: true,
});
`

and some other thing,if it work sometime i change the input value with js thate is reason for triggring change event and i whould not like this,are you able to create some property in config that take js function and function has been runned after date picked?