You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org> on 2008/06/05 16:31:45 UTC

[jira] Commented: (TRINIDAD-634) chooseDate component ignores l10n for first day of week

    [ https://issues.apache.org/jira/browse/TRINIDAD-634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602661#action_12602661 ] 

Mike Kienenberger commented on TRINIDAD-634:
--------------------------------------------

-    int firstDOW = displayedCalendar.getMinimum(Calendar.DAY_OF_WEEK);
-    int lastDOW = displayedCalendar.getMaximum(Calendar.DAY_OF_WEEK);
-    int dowCount = lastDOW - firstDOW + 1;
+    int firstDOW = GregorianCalendar.getInstance(TimeZone.getDefault()).getFirstDayOfWeek();	    
+    int lastDOW =  firstDOW == Calendar.SUNDAY ? Calendar.SATURDAY : firstDOW - 1;	    
+    int dowCount = _DAYS_OF_WEEK ;
 

It would probably make more sense to calculate lastDOW using the following since there's no guarantee that SUNDAY is numerically the first day of the week.

+    int lastDOW =  firstDOW == displayedCalendar.getMinimum(Calendar.DAY_OF_WEEK) ? displayedCalendar.getMaximum(Calendar.DAY_OF_WEEK) : firstDOW - 1;	    


> chooseDate component ignores l10n for first day of week
> -------------------------------------------------------
>
>                 Key: TRINIDAD-634
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-634
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.0.2-core, 1.2.2-core
>            Reporter: Simon Lessard
>            Assignee: Simon Lessard
>            Priority: Minor
>         Attachments: ChooseDateRenderer.patch
>
>
> Currently, chooseDate always uses Sunday as the first day of the week because Calendar.getMinimum() does not take the localisation into account while getFirstDayOfWeek does. We've been told it's incorrect as many countries use Monday as the first day of the week.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.