Skip to content

Commit

Permalink
End Date Format Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
niharikasingh84 committed Jul 22, 2019
1 parent 6d8c56f commit 65d5e57
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -839,15 +839,17 @@ private Date getDate(String key, SimpleDateFormat format, Map<String, Object> ma
return format.parse(format.format(new Date()));
} else {
if (StringUtils.isNotBlank((String) map.get(key))) {
Calendar cal =
Calendar.getInstance(
TimeZone.getTimeZone(ProjectUtil.getConfigValue(JsonKey.SUNBIRD_TIMEZONE)));
cal.setTime(format.parse((String) map.get(key)));
Date d = format.parse((String) map.get(key));
if (key.equals(END_DATE) || key.equals(ENROLLMENT_END_DATE)) {
Calendar cal =
Calendar.getInstance(
TimeZone.getTimeZone(ProjectUtil.getConfigValue(JsonKey.SUNBIRD_TIMEZONE)));
cal.setTime(d);
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
return cal.getTime();
}
return cal.getTime();
return d;
} else {
return null;
}
Expand Down

0 comments on commit 65d5e57

Please sign in to comment.