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 021fd3f commit 6d8c56f
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.*;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
Expand Down Expand Up @@ -845,11 +839,15 @@ 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))) {
Date date = format.parse((String) map.get(key));
if (key.equals(JsonKey.END_DATE) || key.equals(JsonKey.ENROLLMENT_END_DATE)) {
date.setTime(date.getTime() + 86340 * 1000);
Calendar cal =
Calendar.getInstance(
TimeZone.getTimeZone(ProjectUtil.getConfigValue(JsonKey.SUNBIRD_TIMEZONE)));
cal.setTime(format.parse((String) map.get(key)));
if (key.equals(END_DATE) || key.equals(ENROLLMENT_END_DATE)) {
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
}
return date;
return cal.getTime();
} else {
return null;
}
Expand Down

0 comments on commit 6d8c56f

Please sign in to comment.