Created
January 19, 2022 23:22
-
-
Save jamesasu/01c0e7e334f19bb02b536f041a2226a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String dateUpdatedQueryString = ""; | |
Integer numberOfDays = (Integer) context.NumberOfDays; | |
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); | |
if (numberOfDays != null && numberOfDays > 0) { | |
java.util.Calendar today = java.util.Calendar.getInstance(); | |
today.setTime(new Date()); | |
today.add(java.util.Calendar.DATE, -numberOfDays); | |
dateUpdatedQueryString = "&DateUpdated[after]=" + DATE_FORMAT.format(today.getTime()); | |
System.out.println("dateUpdatedQueryString: " + dateUpdatedQueryString); | |
} | |
globalMap.put("dateUpdatedQueryString", dateUpdatedQueryString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment