Commit e9df5d14 authored by Cristian Berner's avatar Cristian Berner 💎
Browse files

Fixes ISSUE-44688: Format date using provided timezone in OBBindings#formatDate

Previously as a side-effect date was being converted to UTC wrongly in
OBBindings formatDate function.
This fixes it by formatting using the local timezone as was previously
done prior to the regression commit. Fixes display of date in some
parameter windows that were relying on it (e.g. Costing Rules).

Fixes regression introduced in commit 4ec715bf
parent 3b7b1306
......@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
* All portions are Copyright (C) 2010-2019 Openbravo SLU
* All portions are Copyright (C) 2010-2020 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
......@@ -33,6 +33,7 @@ import org.openbravo.base.util.Check;
import org.openbravo.base.util.OBClassLoader;
import org.openbravo.base.weld.WeldUtils;
import org.openbravo.client.application.window.ApplicationDictionaryCachedStructures;
import org.openbravo.client.kernel.reference.DateTimeUIDefinition;
import org.openbravo.client.kernel.reference.UIDefinitionController;
import org.openbravo.dal.core.OBContext;
import org.openbravo.dal.service.OBDal;
......@@ -210,7 +211,8 @@ public class OBBindings {
}
public String formatDateTime(Date d) {
return UIDefinitionController.DATETIME_UI_DEFINITION.convertToClassicString(d);
return ((DateTimeUIDefinition) UIDefinitionController.DATETIME_UI_DEFINITION)
.convertToClassicStringInLocalTime(d);
}
public String formatDateTime(Object d) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment