re PR libgcj/21736 (MessageFormat("{0,time,medium}") fails)
2005-05-24 Gary Benson <gbenson@redhat.com> PR libgcj/21736: * java/text/MessageFormat.java (MessageFormatElement.setLocale): Handle DateFormat.DEFAULT case correctly. From-SVN: r100154
This commit is contained in:
parent
93f8e21b71
commit
81043a94e9
2 changed files with 10 additions and 1 deletions
|
@ -113,6 +113,7 @@ public class MessageFormat extends Format
|
|||
formatClass = java.util.Date.class;
|
||||
|
||||
int val = DateFormat.DEFAULT;
|
||||
boolean styleIsPattern = false;
|
||||
if (style == null)
|
||||
;
|
||||
else if (style.equals("short"))
|
||||
|
@ -123,13 +124,15 @@ public class MessageFormat extends Format
|
|||
val = DateFormat.LONG;
|
||||
else if (style.equals("full"))
|
||||
val = DateFormat.FULL;
|
||||
else
|
||||
styleIsPattern = true;
|
||||
|
||||
if (type.equals("time"))
|
||||
format = DateFormat.getTimeInstance(val, loc);
|
||||
else
|
||||
format = DateFormat.getDateInstance(val, loc);
|
||||
|
||||
if (style != null && val == DateFormat.DEFAULT)
|
||||
if (styleIsPattern)
|
||||
{
|
||||
SimpleDateFormat sdf = (SimpleDateFormat) format;
|
||||
sdf.applyPattern(style);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue