Ravichandra
Ravichandra

Reputation: 1270

JQUERY datepicker calendar, how can I rename the "done" button to "close"

How can i rename the Done button text to "Close", the code as follows,

jQuery("#fromDatepicker, #toDatepicker").datepicker({

    showButtonPanel: true,
    changeMonth : true,
    changeYear : true,
    dateFormat: 'mm/dd/yy',     
});

the above code displays JQuery datepicker calendar, Done button is present in Button Panel, i would like to change the "Done" text to "Close". Please any one help me.

Upvotes: 8

Views: 9434

Answers (4)

user5987717
user5987717

Reputation:

$("#fromDatepicker, #toDatepicker").datepicker("option", "closeText", "close");

Upvotes: 0

BehranG BinA
BehranG BinA

Reputation: 512

add Close Text: for example change it to clear

closeText: 'Clear'

Upvotes: 0

JMax
JMax

Reputation: 26601

You should add the closeText option to your call.

jQuery("#fromDatepicker, #toDatepicker").datepicker({

    showButtonPanel: true,
    changeMonth : true,
    changeYear : true,
    dateFormat: 'mm/dd/yy',
    closeText : "Close"
});

Upvotes: 10

Alex K.
Alex K.

Reputation: 175896

Provide closeText: "close"

or

$("#fromDatepicker, #toDatepicker").datepicker("option", "closeText", "close");

Upvotes: 4

Related Questions