James Dickens James Dickens - 4 months ago 20
jQuery Question

JQuery Datepicker selecting year

I wish for the user to be able to select the year without having to click on the prev or next tab relating to months. How can I accomplish this. Here is my code so far:

if ( $('[type="date"]').prop('type') != 'date' ) {
$('[type="date"]').datepicker({
//Something here

});
}

Answer

this is my configuration of datepiker I use font awesome icon so just igonore that. what you want is the changeyear param.

$('#elementID').datepicker({ 
    showOn: 'both',
    buttonText: "<i class='fa fa-calendar fa-lg blue'></i>",
    changeMonth: true,
    changeYear: true
});
Comments