formatter fix

This commit is contained in:
2013-11-25 18:07:34 +04:00
parent f9a616de19
commit ad0702fe1b

View File

@@ -9,8 +9,7 @@ class Formatter implements IFormatter {
var locale:ILocale = Provider.get(ILocale);
var r:EReg = ~/\{(\w+)\}/g;
return r.map(format, function(r:EReg):String {
var pattern:String = r.matched(1);
return switch(pattern) {
return switch(r.matched(1)) {
case "ss": doubleDigit(date.getSeconds());
case "nn": doubleDigit(date.getMinutes());
case "hh": doubleDigit(date.getHours());
@@ -19,9 +18,8 @@ class Formatter implements IFormatter {
case "yyyy": date.getFullYear() + "";
case "month": locale.getArray("month")[date.getMonth()];
case "Month": firstLetterUp(locale.getArray("month")[date.getMonth()]);
default: return "";
default: r.matched(0);
}
return r.matched(0);
});
}