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

translate date in current locale #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public ModelAndView getEventList(ResourceRequest request, ResourceResponse respo
// define a DateFormat object that uniquely identifies dates in a way
// that can easily be ordered
DateTimeFormatter orderableDf =
new DateTimeFormatterBuilder().appendPattern("yyyy-MM-dd").toFormatter().withZone(tz);
new DateTimeFormatterBuilder().appendPattern("yyyy-MM-dd").toFormatter().withZone(tz).withLocale(request.getLocale());

// define a DateFormat object that can produce user-facing display
// as user-facing get it from i18N
Expand All @@ -136,7 +136,7 @@ public ModelAndView getEventList(ResourceRequest request, ResourceResponse respo
"date.formatter.display", null, "EEE MMM d", request.getLocale());
// names for dates
DateTimeFormatter displayDf =
new DateTimeFormatterBuilder().appendPattern(displayPattern).toFormatter().withZone(tz);
new DateTimeFormatterBuilder().appendPattern(displayPattern).toFormatter().withZone(tz).withLocale(request.getLocale());

// define "today" and "tomorrow" so we can display these specially in the user interface
DateMidnight now = new DateMidnight(tz);
Expand Down