Author: jleroux
Date: Tue Jun 7 17:47:56 2011
New Revision: 1133111
URL:
http://svn.apache.org/viewvc?rev=1133111&view=revLog:
A patch from Stephen Rufle "CalendarDateSelect Shows wrong selected date"
https://issues.apache.org/jira/browse/OFBIZ-4308I entered 2011-05-03, the image shows 2011-05-02 selected. Changing the standard '-' to a '/' and then letting parseFormattedString be called seems to fix the issue locally
Modified:
ofbiz/branches/release10.04/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js
Modified: ofbiz/branches/release10.04/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=1133111&r1=1133110&r2=1133111&view=diff==============================================================================
--- ofbiz/branches/release10.04/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (original)
+++ ofbiz/branches/release10.04/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Tue Jun 7 17:47:56 2011
@@ -360,6 +360,8 @@ CalendarDateSelect.prototype = {
{
var value = $F(this.target_element).strip()
this.selection_made = (value != "");
+ var patt=/[-]/gi;
+ value = value.replace(patt,'/');
this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value);
if (isNaN(this.date)) this.date = new Date();
if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? this.yearRange().start : this.yearRange().end);