You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gc...@apache.org on 2010/06/08 22:28:03 UTC

svn commit: r952806 - in /myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs: CoreFormat.js DateFormat.js

Author: gcrawford
Date: Tue Jun  8 20:28:03 2010
New Revision: 952806

URL: http://svn.apache.org/viewvc?rev=952806&view=rev
Log:
TRINIDAD-1818 TrDateTimeRangeValidator should validate using date object, not date string

Modified:
    myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
    myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js

Modified: myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js?rev=952806&r1=952805&r2=952806&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js (original)
+++ myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js Tue Jun  8 20:28:03 2010
@@ -568,12 +568,17 @@ TrLengthValidator.prototype.validate  = 
 }
 
 function TrDateTimeRangeValidator(
-  maxValue,
-  minValue,
-  messages)
+  maxValueString,
+  minValueString,
+  messages,
+  maxValueObject,
+  minValueObject
+  )
 {
-  this._maxValue = maxValue;
-  this._minValue = minValue;
+  this._maxValue = maxValueString;
+  this._minValue = minValueString;
+  this._maxValueObject = maxValueObject;
+  this._minValueObject = minValueObject;
   this._messages = messages;
   // for debugging
   this._class = "TrDateTimeRangeValidator";
@@ -612,12 +617,15 @@ TrDateTimeRangeValidator.prototype.valid
   dateTime = value.getTime();
   var facesMessage;
   //range
-  if(this._minValue && this._maxValue)
+  if (this._minValue && this._maxValue)
   {
     try
     {
-      minDate = (converter.getAsObject (this._minValue)).getTime();
-      maxDate = (converter.getAsObject (this._maxValue)).getTime();
+      minDate = this._minValueObject ? this._minValueObject.getTime() : 
+        converter.getAsObject(this._minValue).getTime();
+        
+      maxDate = this._maxValueObject ? this._maxValueObject.getTime() : 
+        converter.getAsObject(this._maxValue).getTime();
     }
     catch (e)
     {
@@ -658,7 +666,8 @@ TrDateTimeRangeValidator.prototype.valid
     {
       try
       {
-        minDate = (converter.getAsObject (this._minValue)).getTime();
+        minDate = this._minValueObject ? this._minValueObject.getTime() : 
+          converter.getAsObject(this._minValue).getTime();
       }
       catch (e)
       {
@@ -696,8 +705,8 @@ TrDateTimeRangeValidator.prototype.valid
     {
       try
       {
-      maxDate = (converter.getAsObject (this._maxValue)).getTime();
-        
+        maxDate = this._maxValueObject ? this._maxValueObject.getTime() : 
+          converter.getAsObject(this._maxValue).getTime();
       }
       catch (e)
       {

Modified: myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js?rev=952806&r1=952805&r2=952806&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js (original)
+++ myfaces/trinidad/branches/2.0.0.3.1-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js Tue Jun  8 20:28:03 2010
@@ -538,7 +538,7 @@ function _subparse(
         {
           if (eraIndex == 0)
           {
-            parseContext.isBC = true;
+            parseContext.parsedBC = true;
           }
         }
         else