Reputation: 49384
For some reason when I load the Calendar it's opening on date ... July 1906
Here is the code:
var thisTheme = o.pickPageButtonTheme;
var fd=1+self.theDate.getMonth() +'/'+ today+'/'+self.theDate.getFullYear();
if ( ( today === highlightDay || today === presetDay || dates.contains(fd) ) ) { thisTheme = o.pickPageHighButtonTheme; }
$('<div><a href="view-paginated.php#&ui-page=Event-Date--2011-01-31-0">' + today + '</a></div>')
.addClass('ui-datebox-griddate ui-corner-all ui-btn-up-'+thisTheme)
.attr('data-date', today)
.appendTo(thisRow)
.click(function(e) {
e.preventDefault();
self.theDate.setDate($(this).attr('data-date'));
self.input.val(self._formatDate(self.theDate));
self.close();
self.input.trigger('change');
}).hover(
function() { $(this).addClass('ui-btn-down-'+thisTheme).removeClass('ui-btn-up-'+thisTheme); },
function() { $(this).addClass('ui-btn-up-'+thisTheme).removeClass('ui-btn-down-'+thisTheme); }
);
today++;
}
}
And the other part of the code is here:
<input value="1-1-2011" name="date" type="date" data-role="datebox" id="date" data-theme="a" data-options='{"mode": "calbox", "pickPageTheme": "a", "pickPageHighButtonTheme": "e", "setDateButtonLabel": "Calendar"}'/>
It seems to be related to the FormatDate.
How can I change this please?
Thanks
Upvotes: 1
Views: 1907
Reputation: 1984
Well, why it picked 1906 is beyond me - but you arbitrarily picked a date format, you'll need to let datebox know about it before it will pick it up. Give something like this a shot and see if it works:
<input value="1-1-2011" ... data-options='{"dateFormat":"mm-dd-YYYY", "mode": "calbox", "pickPageTheme": "a", "pickPageHighButtonTheme": "e", "setDateButtonLabel": "Calendar"}'/>
dateFormat takes the following:
Additionally, DateBox has had some pretty serious modifications done to how it detects dates, but please let me know if it persists, I'll try to duplicate and correct it.
Upvotes: 1