nehakadam / DateTimePicker

Responsive jQuery DateTime Picker plugin for Web & Mobile
https://nehakadam.github.io/DateTimePicker/
MIT License
357 stars 115 forks source link

Any Way to get the ID of the input field clicked? #96

Open mooseindia opened 8 years ago

mooseindia commented 8 years ago

Hi,

Am trying to put multiple Pickers on my page on click of button. I wanted to know if there is any way i can find out id of input field clicked.

nehakadam commented 8 years ago

You can use beforeShow callback function with oInputElement as an argument and get id with $(oInputElement).attr("id").

Refer demo/Callback-beforeShow.htm

lalitha123 commented 8 years ago

Hi I am using "formatDateTimeString" call back function as follows to find out id of input field clicked as i am using multiple date pickers with different id's.

formatDateTimeString: function(oDate, sMode,$oElem) {
console.log($oElem); }

Please let me know if I can get the id through above call back function.

nehakadam commented 8 years ago

Hi,

Now you will be able get "id" of the element.

formatDateTimeString: function(oDate, sMode, oElem)
{
    console.log($(oElem)attr("id"));
}
lalitha123 commented 8 years ago

Hi

I have set the dateTimeFormat property to 'dd-MM-yyyy hh:mm AA' but the datetime picker is allowing the past time also.

Can you please suggest me to time should not allow the past time from current time?

nehakadam commented 8 years ago

You can set minDateTime to achieve that. Go through Example.