From 28cd7bf4807ebacb97892c01529350ec3e3ae8c7 Mon Sep 17 00:00:00 2001 From: icrc-toliveira Date: Fri, 21 Oct 2022 16:08:35 +0100 Subject: [PATCH] RA-1988 - Although changing time and changing timezone and intrinsically correlated, the more apropiated global property for this use case seems to be GP_TIMEZONE_CONVERSIONS --- .../controller/visit/VisitDatesFragmentController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/omod/src/main/java/org/openmrs/module/coreapps/fragment/controller/visit/VisitDatesFragmentController.java b/omod/src/main/java/org/openmrs/module/coreapps/fragment/controller/visit/VisitDatesFragmentController.java index 098bcbbf9..3fe9d570b 100644 --- a/omod/src/main/java/org/openmrs/module/coreapps/fragment/controller/visit/VisitDatesFragmentController.java +++ b/omod/src/main/java/org/openmrs/module/coreapps/fragment/controller/visit/VisitDatesFragmentController.java @@ -19,8 +19,8 @@ import org.openmrs.api.VisitService; import org.openmrs.api.context.Context; import org.openmrs.module.appui.AppUiConstants; -import org.openmrs.module.coreapps.CoreAppsConstants; import org.openmrs.ui.framework.SimpleObject; +import org.openmrs.ui.framework.UiFrameworkConstants; import org.openmrs.ui.framework.UiUtils; import org.openmrs.ui.framework.annotation.SpringBean; import org.springframework.transaction.annotation.Transactional; @@ -40,10 +40,10 @@ public SimpleObject setDuration(@SpringBean("visitService") VisitService visitSe @RequestParam(value="stopDate", required = false) Date stopDate, HttpServletRequest request, UiUtils ui) { - boolean allowChangingVisitTime = BooleanUtils.toBoolean(Context.getAdministrationService().getGlobalProperty(CoreAppsConstants.GP_ALLOW_CHANGING_VISIT_TIME)); + boolean allowConvertingTimezones = BooleanUtils.toBoolean(Context.getAdministrationService().getGlobalProperty(UiFrameworkConstants.GP_TIMEZONE_CONVERSIONS)); if (!isSameDay(startDate, visit.getStartDatetime())) { - if(!allowChangingVisitTime){ + if(!allowConvertingTimezones){ visit.setStartDatetime(new DateTime(startDate).toDateMidnight().toDate()); }else{ visit.setStartDatetime(new DateTime(startDate).toDate());