jQuery UI Date Picker min and max dates

maqskywalker used Ask the Experts™
Hi experts,

I'm using the jQuery UI DatePicker on a html page.

I saw the Restrict Date Range example at this url.

This is example is the same as the Restrict Date Range example.

The min date is to 20 days prior to today's date.

Anyone know how i set the min date to be the first day of the current year and the max date to be the last date of the current year?

So since the current year is 2015  the min date is  01/01/2015 and the max date is 12/31/2015?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Engineer
Try this:
                minDate: new Date((new Date()).getFullYear(), 1 - 1, 1),
                maxDate: new Date((new Date()).getFullYear(), 12 - 1, 31)

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial