开发者

Android: formatting standalone month

I have a problem formatting standalone month for android.

In documentation exist a list of used symbols for SimpleDateFormat class. http://developer.android.com/reference/java/text/SimpleDateFormat.html

But when I'm trying to call this

SimpleDateFormat llll = new SimpleDateFormat("LLLL", calendarLocale);
llll.format(myCalendar.getTime());

I got exception

Caused by: java.lang.IllegalArgumentException: Unknown pattern character - 'L'
        开发者_开发百科at java.text.SimpleDateFormat.validateFormat(SimpleDateFormat.java:379)
        at java.text.SimpleDateFormat.validatePattern(SimpleDateFormat.java:435)
        at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:499)

From my point it seems that documentation is WRONG. Or am I wrong ?


Do you have ICU jar files ?

Here is the note from the API documentation --

The two pattern characters L and c are ICU-compatible extensions, not available in the RI. These are necessary for correct localization in languages such as Russian that distinguish between, say, "June" and "June 2010".

http://site.icu-project.org/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜