[jdbc] Fix date filter to be inclusive (Derby) (#13850)
Fixes #9906 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>pull/13852/head
parent
93633a9af9
commit
dd8b7c8b65
|
@ -244,12 +244,12 @@ public class JdbcDerbyDAO extends JdbcBaseDAO {
|
|||
String filterString = "";
|
||||
if (filter.getBeginDate() != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME>'" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
|
||||
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
}
|
||||
if (filter.getEndDate() != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME<'" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
|
||||
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
}
|
||||
filterString += (filter.getOrdering() == Ordering.ASCENDING) ? " ORDER BY time ASC" : " ORDER BY time DESC";
|
||||
|
|
Loading…
Reference in New Issue