From 5161b9b5e9f930b1d13ba5b64c27c5a42b089c11 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 26 Nov 2013 19:00:28 -0500 Subject: [PATCH] IDEMPIERE-1542 Calendar doesn't recognise language Date Pattern --- .../src/org/adempiere/webui/dashboard/CalendarWindow.java | 4 ++-- .../WEB-INF/src/org/adempiere/webui/dashboard/DPCalendar.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/CalendarWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/CalendarWindow.java index a173f2fc0d..01f361c1f1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/CalendarWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/CalendarWindow.java @@ -37,6 +37,7 @@ import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ThemeManager; import org.compiere.model.MSysConfig; import org.compiere.model.X_R_RequestType; +import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; @@ -52,7 +53,6 @@ import org.zkoss.calendar.event.CalendarsEvent; import org.zkoss.calendar.impl.SimpleCalendarEvent; import org.zkoss.calendar.impl.SimpleCalendarModel; import org.zkoss.image.AImage; -import org.zkoss.util.Locales; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; @@ -410,7 +410,7 @@ public class CalendarWindow extends Window implements EventListener, ITab private void updateDateLabel() { Date b = calendars.getBeginDate(); Date e = calendars.getEndDate(); - SimpleDateFormat sdfV = new SimpleDateFormat("yyyy/MMM/dd", Locales.getCurrent()); + SimpleDateFormat sdfV = DisplayType.getDateFormat(); sdfV.setTimeZone(calendars.getDefaultTimeZone()); lblDate.setValue(sdfV.format(b) + " - " + sdfV.format(e)); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPCalendar.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPCalendar.java index 3f4bab01af..44bc423668 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPCalendar.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPCalendar.java @@ -38,6 +38,7 @@ import org.compiere.model.PO; import org.compiere.model.X_R_RequestType; import org.compiere.util.CLogger; import org.compiere.util.DB; +import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Trx; import org.compiere.util.TrxEventListener; @@ -49,7 +50,6 @@ import org.zkoss.calendar.Calendars; import org.zkoss.calendar.api.CalendarEvent; import org.zkoss.calendar.event.CalendarsEvent; import org.zkoss.calendar.impl.SimpleCalendarModel; -import org.zkoss.util.Locales; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Desktop; import org.zkoss.zk.ui.Executions; @@ -397,7 +397,7 @@ public class DPCalendar extends DashboardPanel implements EventListener, private void updateDateLabel() { Date b = calendars.getBeginDate(); Date e = calendars.getEndDate(); - SimpleDateFormat sdfV = new SimpleDateFormat("yyyy/MMM/dd", Locales.getCurrent()); + SimpleDateFormat sdfV = DisplayType.getDateFormat(); sdfV.setTimeZone(calendars.getDefaultTimeZone()); lblDate.setValue(sdfV.format(b) + " - " + sdfV.format(e)); }