How do I get the date from a datepicker that doesn't display the entire date?
I have a datepicker initialized as such:
$('.DatePicker').datepicker({ constrainInput: true, format: 'm/d', onSelect: OnDatePickerMonthDayOnlyChanged });
function OnDatePickerMonthDayOnlyChanged(dateText, inst)
{
var element = $(this);
var selectedDate = element.datepicker('getDate');
}
The problem that I'm having is that if I pick a date in a previous year (e.g. 1/4/2003), it gets formatted without the year in my datepicker (e.g. "1/4"). It appears that since there is no year displayed in the textbox, it just uses the current year when I call getDate. So datepicker('getDate') would return 1/4/2010 instead of 1/4/2003.
I'm on jQuery UI 1.7.1. Am I doing something wrong?
Jon