Author: tam_nguyen
Date: 2009-10-26 05:54:31 -0400 (Mon, 26 Oct 2009)
New Revision: 431
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js
Log:
GTNPORTAL-68 Error when change time when create/edit page
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js 2009-10-26
04:14:57 UTC (rev 430)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js 2009-10-26
09:54:31 UTC (rev 431)
@@ -69,7 +69,6 @@
UICalendar.prototype.show = function() {
document.onmousedown = new Function('eXo.webui.UICalendar.hide()') ;
-
var re = /^(\d{1,2}\/\d{1,2}\/\d{1,4})\s*(\s+\d{1,2}:\d{1,2}:\d{1,2})?$/i ;
this.selectedDate = new Date() ;
@@ -109,6 +108,10 @@
var secondIndex = this.datePattern.indexOf("ss");
var secondValue = parseInt(dateFieldValue.substring(secondIndex,secondIndex+2),10);
+ if(isNaN(secondValue)) { secondValue = "00"; }
+ if(isNaN(minutesValue)) { minutesValue = "00"; }
+ if(isNaN(hoursValue)) { hoursValue = "00"; }
+
var testDate = "MM/dd/yyyy HH:mm:ss";
testDate = testDate.replace("dd",dateValue);
testDate = testDate.replace("MM",monthValue+1);
@@ -116,6 +119,7 @@
testDate = testDate.replace("HH",hoursValue);
testDate = testDate.replace("mm",minutesValue);
testDate = testDate.replace("ss",secondValue);
+
if (re.test(testDate)) {
this.selectedDate.setDate(dateValue) ;
this.selectedDate.setMonth(monthValue) ;
Show replies by date