commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pär Nils Amsen (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (LANG-1328) FastDateFormat does not support 'EEE' and 'MMM' abbreviations for PT_pt
Date Thu, 04 May 2017 11:40:04 GMT

    [ https://issues.apache.org/jira/browse/LANG-1328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15996594#comment-15996594
] 

Pär Nils Amsen edited comment on LANG-1328 at 5/4/17 11:39 AM:
---------------------------------------------------------------

[~kinow] I'm able to reproduce it in a fresh project! 
Here's a simple repo demonstrating the issue on [Github|https://github.com/paramsen/fastdateformatissue]
(Android). In [MainActivity#18|https://github.com/paramsen/fastdateformatissue/blob/master/app/src/main/java/com/paramsen/fastdateformatissue/MainActivity.java#L18]
the formatting happens, which produces "Domingo" instead of "Dom" on Android, the two relevant
lines:

{code:java}
String formatted = FastDateFormat.getInstance("EEE", TimeZone.getTimeZone("UTC"), new Locale("pt",
"pt")).format(1494115200);
((TextView) findViewById(R.id.dateFormat)).setText(formatted);
{code}

The result is "Domingo".


was (Author: par.nils.amsen@gmail.com):
[~kinow] I'm able to reproduce it in a fresh project! 
Here's a simple repo demonstrating the issue on [Github|https://github.com/paramsen/fastdateformatissue]
(Android). In [MainActivity#18|https://github.com/paramsen/fastdateformatissue/blob/master/app/src/main/java/com/paramsen/fastdateformatissue/MainActivity.java#L18]
the formatting happens, which produces "Dormido" instead of "Dor" on Android, the two relevant
lines:

{code:java}
String formatted = FastDateFormat.getInstance("EEE", TimeZone.getTimeZone("UTC"), new Locale("pt",
"pt")).format(1494115200);
((TextView) findViewById(R.id.dateFormat)).setText(formatted);
{code}

Could it be that the FastDateFormat uses some built in stuff from the Android platform/shipped
Java source to do the formatting?

> FastDateFormat does not support 'EEE' and 'MMM' abbreviations for PT_pt
> -----------------------------------------------------------------------
>
>                 Key: LANG-1328
>                 URL: https://issues.apache.org/jira/browse/LANG-1328
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 3.3.2
>         Environment: Android
>            Reporter: Pär Nils Amsen
>
> For the following statement:
> {code:java}
> FastDateFormat.getInstance("MMM", timeZone, new Locale("pt", "pt")).format(1494115200);
> {code}
> The outcome will be "dormingo" instead of "dor" in Portugese (pt_PT). I expect this to
be a bug since the only reason for FastDateFormat to not abbreviate the weekdays would be
that Portugese does not allow it, not very likely.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message