Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #374 from ggalmazor/issue_373_temporal_filters_aft…
Browse files Browse the repository at this point in the history
…er_upgrade

Issue 373 Temporal filters after upgrading to v2.0
  • Loading branch information
ggalmazor authored Jan 14, 2019
2 parents 6f6b9eb + de1c604 commit b0882f7
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,13 @@ public QueryByUIFilterGroup(IForm form, FilterGroup filterGroup, CompletionFlag
super.addFilter(fem, op, compareValue);
break;
case JRDATETIME:
if (fem.getFormDataModel() == null && fem.getElementName().contains("meta-"))
case JRDATE:
case JRTIME:
if (isLegacyTemporalField(fem))
super.addFilter(fem, op, compareValue);
else if (fem.getFormDataModel() != null)
super.addFilterChildren(fem, column.getChildColumnCode(), op, compareValue);
else
throw new IllegalArgumentException("Unrecognized dateTime field");
super.addFilterChildren(fem, column.getChildColumnCode(), op, compareValue);
break;
case JRDATE:
case JRTIME:
case GEOPOINT:
super.addFilterChildren(fem, column.getChildColumnCode(), op, compareValue);
break;
Expand All @@ -166,6 +164,11 @@ else if (fem.getFormDataModel() != null)

}

private boolean isLegacyTemporalField(FormElementModel fem) {
return fem.getFormDataModel() == null && fem.getElementName().contains("meta-")
|| fem.getFormDataModel().getChildren().isEmpty();
}

public Object getCompareValue(FormElementModel fem, String value) {
switch (fem.getElementType()) {
case BOOLEAN:
Expand Down

0 comments on commit b0882f7

Please sign in to comment.