Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327846

Summary: The Calendar can't show day title correctly when the locale is China
Product: z_Archived Reporter: hshi <happyfish356>
Component: NebulaAssignee: Emil Crumhorn <emil.crumhorn>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to fix the issue
wim.jongman: iplog+
Test result to apply the fix wim.jongman: iplog-

Description hshi CLA 2010-10-14 21:58:34 EDT
Build Identifier: eclispe 3.6

Please see the  method init()  of class org.eclipse.nebula.widgets.calendarcombo.CalendarComposite
The following is my fix(i change it form line 158)

boolean isCNLocale = mSettings.getLocale().equals(Locale.CHINA) || mSettings.getLocale().equals(Locale.TAIWAN);
for (int i = 0; i < weekdays.length; i++) {
            String weekday = weekdays[i];
            if (weekday.length() > 0) {
                if (isCNLocale) {
                    mDayTitles[i] = weekday.substring(2, 3).toUpperCase();
                } else {
                    mDayTitles[i] = weekday.substring(0, 1).toUpperCase();
                }
            }
        }

Reproducible: Always

Steps to Reproduce:
1 Create a project to use the CalendarComposite
2 Not only CalendarComposite but also other component related to calendar also have such kind of issue
Comment 1 hshi CLA 2010-10-14 22:33:05 EDT
Created attachment 180923 [details]
Patch to fix the  issue

Maybe other Calendar component also need to fix
Comment 2 hshi CLA 2010-10-14 22:50:37 EDT
Created attachment 180924 [details]
Test result to apply the fix

Test result to apply the fix
Comment 3 Emil Crumhorn CLA 2011-09-24 11:45:05 EDT
Sorry for taking ages to get to this. Patch applied and checked in to CVS. Thank you!