-3

How to set today date and tomorrow date for Datepicker?

JS File here

Image in website

X

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

If you want to set the current date of the jquery datepicker, use the setDateoption.

This can be done on the fly with $('#dateselector').datepicker("setDate", new Date() ) (soucre)

If you want to set the date to tomorrow, use $("#dateselector").datepicker("setDate", "1"); (source)

Or you can use setDate when you're first setting up your datepicker with:

$('#dateselector').datepicker({'setDate': new Date()});

These sources were found with a very easy Google search. Typically, when posting a question, you want to show your code, what you've tried, and what errors you're getting. Good Luck!

Travis Heeter
  • 13,002
  • 13
  • 87
  • 129
  • 2
    [Should one advise on off topic questions?](https://meta.stackoverflow.com/questions/276572/should-one-advise-on-off-topic-questions) By not providing code, as you yourself state, the question is off topic. You should be voting to close, not answering it. – Rob Oct 18 '18 at 20:21