@@ -44,6 +44,7 @@ public static String queryStringBuilder(HttpServletRequest request, StringBuffer
4444 String jdoqlVariableDeclaration = "" ;
4545 String parameterDeclaration = "" ;
4646 String context = "context0" ;
47+ long endOfDayMilliseconds = 24 * 60 * 60 * 1000 - 1 ;
4748
4849 context = ServletUtilities .getContext (request );
4950 Shepherd myShepherd = new Shepherd (context );
@@ -1442,7 +1443,7 @@ public static String queryStringBuilder(HttpServletRequest request, StringBuffer
14421443 long date1Millis = date1 .getMillis ();
14431444 long date2Millis = date2 .getMillis ();
14441445 // if same dateTime is set by both pickers, then add a full day of milliseconds to picker2 to cover the entire day
1445- date2Millis += ( 24 * 60 * 60 * 1000 - 1 ) ;
1446+ date2Millis += endOfDayMilliseconds ;
14461447
14471448 prettyPrint .append ("Dates between: " +
14481449 date1 .toString (ISODateTimeFormat .date ()) + " and " +
@@ -1472,10 +1473,10 @@ public static String queryStringBuilder(HttpServletRequest request, StringBuffer
14721473 date2 .toString (ISODateTimeFormat .date ()) + "<br />" );
14731474 if (filter .equals (SELECT_FROM_ORG_ECOCEAN_ENCOUNTER_WHERE )) {
14741475 filter += "((dwcDateAddedLong >= " + date1 .getMillis () +
1475- ") && (dwcDateAddedLong <= " + date2 .getMillis () + "))" ;
1476+ ") && (dwcDateAddedLong <= " + ( date2 .getMillis ()+ endOfDayMilliseconds ) + "))" ;
14761477 } else {
14771478 filter += " && ((dwcDateAddedLong >= " + date1 .getMillis () +
1478- ") && (dwcDateAddedLong <= " + date2 .getMillis () + "))" ;
1479+ ") && (dwcDateAddedLong <= " + ( date2 .getMillis ()+ endOfDayMilliseconds ) + "))" ;
14791480 }
14801481 } catch (NumberFormatException nfe ) {
14811482 // do nothing, just skip on
0 commit comments