[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-623) <s:selectDate> localization

Stephan Bublava (JIRA) jira-events at jboss.com
Wed Jan 10 12:10:26 EST 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-623?page=all ]

Stephan Bublava updated JBSEAM-623:
-----------------------------------

    Attachment: selectdate-localization-patch-2.txt

Here's a followup to my first patch, which supports localized date formats, button names and fixes one minor error in the first one.

It seems that Ronald has also been working on this problem (even on the same day :), so we'll probably need to merge the two patches somehow.

Changes:

1) SelectDate.java attempts to determine the correct date format (day, month, year order) and separator by using the date converter attached to the "for" component and passes the values to displayDatePicker().

2) The labels for the two buttons ("Close", "This Month"), which are hidden by default, can now be localized by adding messages with these keys:

- org.jboss.seam.ui.SelectDate.close
- org.jboss.seam.ui.SelectDate.thisMonth

3) The date parser in selectDate.js did not handle two-digit years correctly and always used 19xx in that case. The new logic should match SimpleDateFormat.java (to avoid inconsistencies).

4) In my first patch I added markup to allow highlighting of weekends (Saturyday, Sunday). The new version only highlights Sundays (if desired), but we can aslo remove this feature again.

Thanks,
Stephan

> <s:selectDate> localization
> ---------------------------
>
>                 Key: JBSEAM-623
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-623
>             Project: JBoss Seam
>          Issue Type: Patch
>          Components: JSF
>    Affects Versions: 1.1.0.GA
>            Reporter: Stephan Bublava
>         Assigned To: Norman Richards
>            Priority: Minor
>             Fix For: 1.1.1.GA
>
>         Attachments: adding-local-to-selectdate-display.txt, selectDate-dateFormat-patch.txt, selectdate-localization-patch-2.txt, selectdate-localization-patch.txt
>
>
> Currently <s:selectDate> is not locale-aware. This affects day names, month names, buttons as well as the date string written to the text field via JavaScript.
> selectdate-localization-patch.txt is a first step to improve this.
> Changes include:
> - Weekends use a distinct CSS style and can be highlighted if desired. (I've changed the booking example to demonstrate this).
> - The first day of the week is no longer harcoded to Sunday, but calculated according to the current locale settings (e.g. Monday for German).
> - Day and month names are localised as well.
> Open issues:
> - Weekends are hardcoded to Saturday and Sunday. I have no idea how determine this info using Calendar, &c. APIs.
> - Date formats are not kept in sync between JSF and JavaScript, which always uses MM/DD/YYYY, regardless of the locale.
> - Button names ("close", "this month") are still hardcoded.
> - It might be more flexible, to translate day / month names with the application ResourceBundle instead of using DateFormatSymbols.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list