Author: matzew
Date: Wed Jan 17 08:25:02 2007
New Revision: 497065
URL: http://svn.apache.org/viewvc?view=rev&rev=497065
Log:
enhancing the dateRestrictionValidator to show Monday (or Montag) instead of
Mon (which would be the value set on the tag).
Same done for the month (December or Dezember istead of Dec)
Modified:
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
Modified:
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
URL:
http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js?view=diff&rev=497065&r1=497064&r2=497065
==============================================================================
---
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
(original)
+++
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
Wed Jan 17 08:25:02 2007
@@ -659,7 +659,9 @@
this._monthValue = monthValue;
this._messages = messages;
this._weekdaysMap =
{'2':'tue','4':'thu','6':'sat','1':'mon','3':'wed','5':'fri','0':'sun'};
+ this._translatedWeekdaysMap =
{'sun':'0','mon':'1','tue':'2','wed':'3','thu':'4','fri':'5','sat':'6'};
this._monthMap =
{'2':'mar','4':'may','9':'oct','8':'sep','11':'dec','6':'jul','1':'feb','3':'apr','10':'nov','7':'aug','5':'jun','0':'jan'};
+ this._translatedMonthMap =
{'jan':'0','feb':'1','mar':'2','apr':'3','may':'4','jun':'5','jul':'6','aug':'7','sep':'8','oct':'9','nov':'10','dec':'11'};
// for debugging
this._class = "TrDateRestrictionValidator";
@@ -670,15 +672,38 @@
converter
)
{
+
+
return _returnHints(
this._messages,
- this._weekdaysValue,
- this._monthValue,
+ this._translate(this._weekdaysValue, this._translatedWeekdaysMap,
converter.getLocaleSymbols().getWeekdays()),
+ this._translate(this._monthValue, this._translatedMonthMap,
converter.getLocaleSymbols().getMonths()),
"org.apache.myfaces.trinidad.validator.DateRestrictionValidator.WEEKDAY_HINT",
"org.apache.myfaces.trinidad.validator.DateRestrictionValidator.MONTH_HINT",
"hintWeek",
"hintMonth"
);
+}
+TrDateRestrictionValidator.prototype._translate = function(
+ values,
+ map,
+ valueArray
+ )
+{
+ if(values)
+ {
+ var translatedValues = new Array();
+ var valuesAsArray = eval(values);
+ for(i = 0; i<valuesAsArray.length; i++)
+ {
+ translatedValues.push(valueArray[map[valuesAsArray[i].toLowerCase()]]);
+ }
+ return eval(translatedValues);
+ }
+ else
+ {
+ return values;
+ }
}
TrDateRestrictionValidator.prototype.validate = function(
value,
Modified:
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
URL:
http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js?view=diff&rev=497065&r1=497064&r2=497065
==============================================================================
---
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
(original)
+++
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/DateFormat.js
Wed Jan 17 08:25:02 2007
@@ -1113,6 +1113,12 @@
return this._offset;
}
+TrDateTimeConverter.prototype.getLocaleSymbols = function()
+{
+ return this._localeSymbols;
+}
+
+
/**
* Parses a String into a Date using the current object's pattern. If the
* parsing fails, undefined will be returned.