Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CmsPublishScheduled fails to parse the date string depending on the workplace locale #23

Closed
pStrudthoff opened this issue Apr 5, 2012 · 1 comment

Comments

@pStrudthoff
Copy link
Contributor

CmsPublishScheduled fails to parse the date string when the workplace locale is
other then the ones with witch the data format is MM/dd/yyyy

How to reproduce:

  1. Set the workplace language Japanese.
  2. Create a resource
  3. Choose Publish Scheduled in the right click context menu.
  4. Choose a date from a calender.
  5. Press OK
  • then an exception will be thrown.

Here is my suggestion for fix:

The problem is that CmsPublishScheduled uses user's workplace locale to
determine which data format string to use. However, the calender widget always
returns MM/dd/yyyy formatted date, unless configured otherwise.


// here is the original code
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,
DateFormat.SHORT, getLocale());
Date date = dateFormat.parse(publishScheduledDate);


So I used CmsCalendarWidget.getCalendarDate() like the other dialogs and
everything worked fine.


// here is my fix--
Date date = new Date(CmsCalendarWidget.getCalendarDate(getMessages(),
publishScheduledDate, true));

gWestenberger added a commit that referenced this issue Oct 1, 2013
@tHerrmann
Copy link

This has been fixed with release of OpenCms 9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants