From a0224894fcc89500a701f39ccaf4322a03231ff6 Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Fri, 25 Feb 2022 16:48:28 +0800 Subject: [PATCH] screen-api 增加达标天数分析接口 --- screen-common/src/main/java/com/moral/util/DateUtils.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/screen-common/src/main/java/com/moral/util/DateUtils.java b/screen-common/src/main/java/com/moral/util/DateUtils.java index 2741da9..3699260 100644 --- a/screen-common/src/main/java/com/moral/util/DateUtils.java +++ b/screen-common/src/main/java/com/moral/util/DateUtils.java @@ -651,6 +651,8 @@ return new Date(); } + + public static String getAfterNDays(Date date, int n, String formateStr) { SimpleDateFormat sdf = new SimpleDateFormat(formateStr); Calendar calendar = new GregorianCalendar(); @@ -1016,6 +1018,19 @@ int year = cal.get(Calendar.YEAR); return year == currentYear; } + + /* + * ��������������������������� + * */ + public static boolean isCurrentMonth(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + int currentYear = cal.get(Calendar.MONTH); + cal.setTime(date); + int year = cal.get(Calendar.MONTH); + return year == currentYear; + } + /** * ������������������������������ @@ -1431,6 +1446,7 @@ return calendar.getTime(); } + /** * <p> * Title: getDays -- Gitblit v1.8.0