Skip to content

Commit

Permalink
HTML-838: Create GP to control default for hiding seconds with the Ti… (
Browse files Browse the repository at this point in the history
#299)

* HTML-838: Create GP to control default for hiding seconds with the Time Widget

* HTML-838: Create GP to control default for hiding seconds with the Time Widget
(fix typo)
  • Loading branch information
mogoodrich authored Feb 26, 2024
1 parent c69dc7b commit 2872f70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class HtmlFormEntryConstants {

public static final String GP_RESTRICT_ENCOUNTER_LOCATION_TO_CURRENT_VISIT_LOCATION = "htmlformentry.restrictEncounterLocationToCurrentVisitLocation";

public static final String GP_TIME_WIDGET_HIDE_SECONDS_DEFAULT = "htmlformentry.timeWidgetHideSecondsDefault";

public final static String GP_TIMEZONE_CONVERSIONS = "timezone.conversions";

public static final String COMPLEX_UUID = "8d4a6242-c2cc-11de-8d13-0010c6dffd0f";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ public class TimeWidget implements Widget {

private boolean hidden;

private boolean hideSeconds = false;
private boolean hideSeconds;

private String timeFormat;

public TimeWidget() {

hideSeconds = "true".equalsIgnoreCase(Context.getAdministrationService()
.getGlobalProperty(HtmlFormEntryConstants.GP_TIME_WIDGET_HIDE_SECONDS_DEFAULT, "false"));
}

private SimpleDateFormat timeFormat() {
Expand Down
5 changes: 5 additions & 0 deletions omod/src/main/resources/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
<defaultValue>false</defaultValue>
<description>When set to true and an encounter is being entered in the context of a visit, the encounter location will be restricted to the current visit location (and it's descendents)</description>
</globalProperty>
<globalProperty>
<property>htmlformentry.timeWidgetHideSecondsDefault</property>
<defaultValue>false</defaultValue>
<description>When rendering the time widget, whether to hide the seconds widget by default</description>
</globalProperty>
<!-- /Required Global Properties -->
//TODO this GP should be removed once the timezone.conversions GP is provided by Core.
<globalProperty>
Expand Down

0 comments on commit 2872f70

Please sign in to comment.