From: Mark D. ☕ <ma...@ma...> - 2011-12-07 20:06:48
|
I would like to propose the following API for: *ICU 49* Please provide feedback by: *Tuesday, 2011-12-20* Designated API reviewer: *Yoshito* Ticket: http://bugs.icu-project.org/trac/ticket/8960 ------------------------------ Many people don't realize that ICU offers very flexible date and time formats. And the code can be cumbersome, using a DateTimePatternGenerator. I suggest adding the following convenience methods: static DateFormat getInstanceForSkeleton(String skeleton) static DateFormat getInstanceForSkeleton(String skeleton, Calendar cal) static DateFormat getInstanceForSkeleton(String skeleton, Calendar cal, Locale locale) static DateFormat getInstanceForSkeleton(String skeleton, Calendar cal, ULocale locale) Internally, these would create a DateTimePatternGenerator, and call getBestPattern(String skeleton), then create a SimpleDateFormat with that pattern. |