diff --git a/src/main/java/cokr/xit/foundation/AbstractComponent.java b/src/main/java/cokr/xit/foundation/AbstractComponent.java index 25af1e4..2d04fd9 100644 --- a/src/main/java/cokr/xit/foundation/AbstractComponent.java +++ b/src/main/java/cokr/xit/foundation/AbstractComponent.java @@ -1,5 +1,6 @@ package cokr.xit.foundation; +import java.util.Date; import java.util.function.Supplier; import javax.annotation.Resource; @@ -202,6 +203,15 @@ public class AbstractComponent { return isEmpty(logName) ? log(getClass()) : Log.get(logName); } + /**주어진 Date에 지정한 날짜수만큼의 차이의 Date를 반환한다. + * @param date 날짜 + * @param days 날짜수 + * @return 새 Date + */ + protected static Date dateDiff(Date date, int days) { + return new Date(date.getTime() + (1000L * 60L * 60L * 24L * days)); + } + /**현재 객체를 반환한다. * @param AbstractComponent 유형 * @return 현재 객체 diff --git a/src/main/java/cokr/xit/foundation/web/AbstractController.java b/src/main/java/cokr/xit/foundation/web/AbstractController.java index 6b6d49d..ec025d1 100644 --- a/src/main/java/cokr/xit/foundation/web/AbstractController.java +++ b/src/main/java/cokr/xit/foundation/web/AbstractController.java @@ -142,7 +142,6 @@ public abstract class AbstractController extends AbstractComponent { * @return ModelAndView */ protected ModelAndView setCollectionInfo(ModelAndView mav, Collection collection, String prefixKey, String prefix) { - boolean toJson = !"jsonView".equals(mav.getViewName()); mav.addObject(prefixKey, prefix) .addObject(prefix + "List", collection) .addObject(prefix + "Start", 0)