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 2007/08/09 11:38:03 UTC

svn commit: r564156 - /myfaces/trinidad/branches/1.2.2-branch/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js

Author: matzew
Date: Thu Aug  9 02:38:02 2007
New Revision: 564156

URL: http://svn.apache.org/viewvc?view=rev&rev=564156
Log:
don't show hints, when there is no restriction regarding weekdays/months

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

Modified: myfaces/trinidad/branches/1.2.2-branch/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.2-branch/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js?view=diff&rev=564156&r1=564155&r2=564156
==============================================================================
--- myfaces/trinidad/branches/1.2.2-branch/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js (original)
+++ myfaces/trinidad/branches/1.2.2-branch/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js Thu Aug  9 02:38:02 2007
@@ -723,14 +723,16 @@
   var allWeekdays = ['mon','tue','wed','thu','fri','sat','sun'];
   var allMonth = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];
   
-  //remove the submitted values, which are invalid, to display only the valid ones
-  TrCollections.removeValuesFromArray(this._weekdaysValue, allWeekdays);
+  //if needed, remove the submitted values, which are invalid, to display only the valid ones
+  if(this._weekdaysValue)
+    TrCollections.removeValuesFromArray(this._weekdaysValue, allWeekdays);
+  if(this._monthValue)
   TrCollections.removeValuesFromArray(this._monthValue, allMonth);
   
   return _returnHints(
     this._messages,
-    this._translate(allWeekdays, this._translatedWeekdaysMap, converter.getLocaleSymbols().getWeekdays()),
-    this._translate(allMonth, this._translatedMonthMap, converter.getLocaleSymbols().getMonths()),
+    !this._weekdaysValue ? this._weekdaysValue : this._translate(allWeekdays, this._translatedWeekdaysMap, converter.getLocaleSymbols().getWeekdays()),
+    !this._monthValue ? this._monthValue : this._translate(allMonth, this._translatedMonthMap, converter.getLocaleSymbols().getMonths()),
     "org.apache.myfaces.trinidad.validator.DateRestrictionValidator.WEEKDAY_HINT",
     "org.apache.myfaces.trinidad.validator.DateRestrictionValidator.MONTH_HINT",
     "hintWeek",