ablerman
ablerman

Reputation: 1543

How can I get the JqueryUI datepicker show "Today" in the input box

When the user selects today in the datepicker, I want the associated input box to show the word "Today".

Is there any reasonable way to accomplish this?

Upvotes: 0

Views: 1202

Answers (2)

user113716
user113716

Reputation: 322562

You could attach a .change() handler to the input that checks the selected date when the value is changed, and updates the value with "Today" if necessary.

Try it out: http://jsfiddle.net/gn4Fj/

$('input').datepicker()
    .change(function() {
        var today = new Date().getDate();
        var val = new Date(this.value).getDate();
        if(today === val)
            this.value = "Today";
});

Upvotes: 1

meder omuraliev
meder omuraliev

Reputation: 186662

Are you looking the showButtonPanel: true option?

Upvotes: 0

Related Questions