Hybreeder Hybreeder - 4 months ago 29
Javascript Question

How to change year range in jquery DateTimePicker?

I am using jquery

DateTimePicker
plugin and I have to change year range form 2008 to 2018.I am using this plugin, Please help me in this.

jQuery('#datetimepicker1').datetimepicker({
timepicker:false,
format:'d-m-Y',
changeMonth: true,
changeYear: true,
yearRange: '2008:2018'
});

Answer

Try following code.

$('#datetimepicker').datetimepicker({
    timepicker:false,
    format:'d-m-Y',
    changeMonth: true, 
    changeYear: true, 
    yearStart : '2008',
    yearEnd :'2018'
});