Skip to content Skip to sidebar Skip to footer

Jquery Datetimepicker - How To Get Date In Javascript?

So I have a jQuery DateTimePicker v2.4.1 attached on a text input. I wanted to make it so then when the user clicks and changes the Month or Year of the picker - it would update th

Solution 1:

onChangeMonth function(current_time,$input){} onChangeYear function(current_time,$input){} onChangeDateTime function(current_time,$input){}

According to its documentation.each onChange functions get Date variable as a first parameter.

    onChangeMonth: function(date,$el) {
        var d = date.getDate();
        //d is selected date.var m = date.getMonth() + 1; //+1 because .getMonth() returns 0-11//m is selected month.
    }

Post a Comment for "Jquery Datetimepicker - How To Get Date In Javascript?"