You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2009/07/02 12:24:46 UTC

svn commit: r790539 - /myfaces/trinidad/branches/1.2.11.4-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js

Author: matzew
Date: Thu Jul  2 10:24:45 2009
New Revision: 790539

URL: http://svn.apache.org/viewvc?rev=790539&view=rev
Log:
client-side patch for TRINIDAD-1524

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

Modified: myfaces/trinidad/branches/1.2.11.4-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.4-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js?rev=790539&r1=790538&r2=790539&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.4-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js (original)
+++ myfaces/trinidad/branches/1.2.11.4-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js Thu Jul  2 10:24:45 2009
@@ -1157,14 +1157,6 @@
   if (parseString.length == 0)
     return null;
 
-  // the following correct parseString "24.12.2009 16:36 Uhr"
-  // causes an error, as the pattern wants an extra empty sting
-  // at the end...
-  if(this._endsWith(parseString, "Uhr"))
-  {
-    parseString += " ";
-  }
-
   var pattern = this._pattern;
   
   var facesMessage;
@@ -1336,7 +1328,15 @@
   localeSymbols,
   msg)
 {
-
+  // When a pattern (e.g. dd.MM.yyyy HH:mm' Uhr ') requires a whitespace
+  // at the end, we should honor that. As the JSF spec (see http://bit.ly/kTelf)
+  // wants the converter to trim leading/trailing whitespace, we have to append
+  // one, if the pattern requires it at the end...
+  if(this._endsWith(parsePattern, " '"))
+  {
+    parseString += " ";
+  }
+	
   var parseContext = new Object();
   parseContext.currIndex = 0;
   parseContext.parseString = parseString;