Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Incomplete
-
5.3.3
-
None
Description
It's currently not easy to override the locale specific date / number formats provided by the JRE. It's also not easy to set a global default for date / number formats (eg in beaneditor or beandisplay). For example, the default edit date format is DateFormat.SHORT whereas the default display format is DateFormat.MEDIUM.
It would be nice if tapestry had overridable services for providing these, eg:
public interface DateFormatProvider {
DateFormat getDefaultDisplayDateFormat();
DateFormat getDefaultEditDateFormat();
DateFormatSymbols getDateFormatSymbols();
}
public interface NumberFormatProvider {
<T> NumberFormat getDefaultDisplayNumberFormat(Class<T extends Number> type);
<T> NumberFormat getDefaultEditNumberFormat(Class<T extends Number> type);
DecimalFormatSymbols getDecimalFormatSymbols();
}
Related issues:
http://tapestry.1045711.n5.nabble.com/Global-setting-for-date-format-td5716054.html
http://tapestry.1045711.n5.nabble.com/tapestry-js-formatLocalizedNumber-td5716714.html