views:

6

answers:

1

I'm working on a site that uses a Jquery UI datepicker to allow users to enter their date of birth. However, since the calender (intialized as follows), doesn't go before December 31st 1969, this will prevent users born before then from registering. How can I make it so that the date goes back all the way to 1910 like intended?

picker.datepicker({
    defaultDate: (field.val() ? new Date(field.val() * 1000) : '-13y'),
    dateFormat: '@',
    changeMonth: true,
    changeYear: true,
    yearRange: '1910:2000',
    minDate: '1910-01-01'
});
+1  A: 

Ugh... figured it out myself.

The minDate I gave it was an ISO 8601 date, but it was expecting a UNIX timestamp.

Changing it to -1893434400 made the picker work.

MiffTheFox