Skip to content

Commit

Permalink
fix: correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cleydyr committed May 14, 2024
1 parent 2abdc22 commit a9986a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/biblivre/cataloging/holding/HoldingDAOImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ private int populatePreparedStatement(PreparedStatement pst, int index, SearchDT
return index;
}

int delta = 1;
int delta = 0;

SearchTermDTO created = null;
SearchTermDTO modified = null;
Expand All @@ -569,15 +569,15 @@ private int populatePreparedStatement(PreparedStatement pst, int index, SearchDT
Date endDate = created.getEndDate();

if (startDate != null) {
pst.setTimestamp(delta++, CalendarUtils.toSqlTimestamp(startDate));
pst.setTimestamp(index + delta++, CalendarUtils.toSqlTimestamp(startDate));
}

if (endDate != null) {
if (CalendarUtils.isMidnight(endDate)) {
endDate = DateUtils.addDays(endDate, 1);
}

pst.setTimestamp(delta++, CalendarUtils.toSqlTimestamp(endDate));
pst.setTimestamp(index + delta++, CalendarUtils.toSqlTimestamp(endDate));
}
}

Expand All @@ -587,15 +587,15 @@ private int populatePreparedStatement(PreparedStatement pst, int index, SearchDT
Date endDate = modified.getEndDate();

if (startDate != null) {
pst.setTimestamp(delta++, CalendarUtils.toSqlTimestamp(startDate));
pst.setTimestamp(index + delta++, CalendarUtils.toSqlTimestamp(startDate));
}

if (endDate != null) {
if (CalendarUtils.isMidnight(endDate)) {
endDate = DateUtils.addDays(endDate, 1);
}

pst.setTimestamp(delta++, CalendarUtils.toSqlTimestamp(endDate));
pst.setTimestamp(index + delta++, CalendarUtils.toSqlTimestamp(endDate));
}
}

Expand Down

0 comments on commit a9986a0

Please sign in to comment.