[Building Sakai] Cannot set date of Samigo while set JAVA_OPTS's locale to zh_CN

=?GB2312?B?uN+sQg==?= gaojun at fudan.edu.cn
Wed Oct 27 02:26:19 PDT 2010


Hi all,

We deploy a test environment of Sakai in Fudan University, and we
planned to put it in use in next semester.
Recently, we found a bug of samigo. I was intended to post this bug to
JIRA, but failed with an error: Error occurred while storing issue.

When set JVM_OPTION's locale to zh_CN, users can not set the date of a
quiz(include start time, end time...).
An error was post in
log:org.sakaiproject.tool.assessment.ui.listener.util.TimeUtil - can not
parse the string into a Date
Because in simplified Chinese, the valid date string is something like
10/28/2010 12:52:01 下午(these Chinese words mean PM), yet the date
picker page put 10/28/2010 12:52:01 AM in the page field. This generate
a DateFormatException.
Since the date picker page has not supported i18n, here's our solution.
Use new SimpleDateFormat(displayDateFormat, Locale.US) instead of new
SimpleDateFormat(displayDateFormat) in files below:
samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AssessmentSettingsBean.java,
line 1493, version 2.7.0
samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/PublishedAssessmentSettingsBean.java,
line 1317, version 2.7.0

We hope the date picker page could support i18n in future.
Anyone has better solution of this?

-- 
Gao Jun
Informatization Office of Fudan University, China




More information about the sakai-dev mailing list