IntegrateThis
IntegrateThis

Reputation: 962

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

});
}

Upvotes: 1

Views: 42

Answers (1)

Charles McIntosh
Charles McIntosh

Reputation: 661

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
});

Upvotes: 2

Related Questions