You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mc...@apache.org on 2014/04/16 02:15:57 UTC

svn commit: r1587763 - /myfaces/trinidad/trunk/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js

Author: mcooper
Date: Wed Apr 16 00:15:57 2014
New Revision: 1587763

URL: http://svn.apache.org/r1587763
Log:
MessageBundle's "org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_XXXX_detail" strings like "Enter a date in the same format as this example: {2}" are meaningless without an example string.
While the Java implementation always provides an example string, some JavaScript implementations might not, so use the actual first pattern as a fallback.

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

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js?rev=1587763&r1=1587762&r2=1587763&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js Wed Apr 16 00:15:57 2014
@@ -1146,7 +1146,11 @@ function TrDateTimeConverter(
 
   // Stash away the patterns for later use.
   this._pattern = patterns;
-  
+
+  // Use a fallback example string if necessary
+  if (this._exampleString == null && patterns != null && patterns.length > 0)
+    this._exampleString = patterns[0];
+
   this._locale = (locale != null) ? locale : getJavaLanguage(locale);
 }