diff --git a/web/src/main/java/org/phoenixctms/ctsms/web/conversion/DurationConverterBase.java b/web/src/main/java/org/phoenixctms/ctsms/web/conversion/DurationConverterBase.java index eae4ce36e610..9ce7f96a9901 100644 --- a/web/src/main/java/org/phoenixctms/ctsms/web/conversion/DurationConverterBase.java +++ b/web/src/main/java/org/phoenixctms/ctsms/web/conversion/DurationConverterBase.java @@ -11,6 +11,8 @@ public abstract class DurationConverterBase implements Converter { + protected abstract boolean isSigned(); + @Override public String getAsString(FacesContext facesContext, UIComponent component, Object value) { if (value == null) { @@ -27,7 +29,8 @@ public String getAsString(FacesContext facesContext, UIComponent component, Obje } } } else if (value instanceof SelectItem) { - return DateUtil.getDurationString((Integer) ((SelectItem) value).getValue(), DurationUnitOfTime.SECONDS, DurationUnitOfTime.SECONDS, 0); + Integer seconds = (Integer) ((SelectItem) value).getValue(); + return (isSigned() ? DateUtil.getSignSymbol(seconds) : "") + DateUtil.getDurationString(seconds, DurationUnitOfTime.SECONDS, DurationUnitOfTime.SECONDS, 0); } else { return CommonUtil.NO_SELECTION_VALUE; } diff --git a/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleDurationConverter.java b/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleDurationConverter.java index 71c8ae255b9c..d456e257a7cb 100644 --- a/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleDurationConverter.java +++ b/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleDurationConverter.java @@ -30,4 +30,9 @@ public Object getAsObject(FacesContext context, UIComponent component, String va return null; } } + + @Override + protected boolean isSigned() { + return false; + } } diff --git a/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleOffsetConverter.java b/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleOffsetConverter.java index 0d8d7dd7a0fd..229b2f069b88 100644 --- a/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleOffsetConverter.java +++ b/web/src/main/java/org/phoenixctms/ctsms/web/conversion/VisitScheduleOffsetConverter.java @@ -30,4 +30,9 @@ public Object getAsObject(FacesContext context, UIComponent component, String va return null; } } + + @Override + protected boolean isSigned() { + return true; + } }