I need the ability for the user to enter time into the calendar input field.
If I set datePattern="MM-dd-yy hh:mm a" the value is formatted correctly when the page loads. And as long as the value is formatted this way the value makes it successfuly into my model.
However if I use the calendar to select the input fields value is replaced and formatted correctly except that hh:mm a is appended to the value.
For example selecting todays date would yield 10.12.07 hh:mm a.
I really just want for the time to be assumed to be 12:00 PM, and if the user needs to change it they can manually.
I modified calendar.js as follows:
getSelectedDateString: function(pattern) {
if (!this.selectedDate) return "";
if (!pattern) pattern = this.params.datePattern;
var formattedDateTime = this.selectedDate.format(pattern, this.params.monthLabels, this.params.monthLabelsShort)
.replace(/hh/, "12")
.replace(/mm/, "00")
.replace(/a/, "PM");
return formattedDateTime;
//return this.selectedDate.format(pattern, this.params.monthLabels, this.params.monthLabelsShort);
},