From 2cf0253cf25e8e74958075eb3d1a1b8eac70356d Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Mon, 09 Aug 2021 08:50:19 +0800 Subject: [PATCH] 去除员工管理菜单。角色分配唯一 --- screen-common/src/main/java/com/moral/util/DateUtils.java | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 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 8e61079..9281bed 100644 --- a/screen-common/src/main/java/com/moral/util/DateUtils.java +++ b/screen-common/src/main/java/com/moral/util/DateUtils.java @@ -1355,4 +1355,37 @@ } return date; } + + /* + * ������������������������������������ + * ������time=2021-08-04 ��������������������������������������� + * time=2021-08 ��������������������������������� + * */ + public static List<String> getTimeLag(String time) { + List<String> result = new ArrayList<>(); + int length = time.length(); + Calendar cal = Calendar.getInstance(); + String end; + String dateFormat; + int i; + if (length == 10) {//��� + end = getDateAddDay(time, 1); + dateFormat = yyyy_MM_dd_EN; + i = Calendar.HOUR_OF_DAY; + } else if (length == 7) {//��� + end = getDateAddMonth(time, 1); + dateFormat = yyyy_MM_EN; + i = Calendar.DAY_OF_MONTH; + } else {//��� + end = getDateAddYear(time, 1); + dateFormat =yyyy; + i = Calendar.MONTH; + } + cal.setTime(getDate(time, dateFormat)); + for (long d = cal.getTimeInMillis(); d < getDate(end, dateFormat).getTime(); cal.set(i, cal.get(i) + 1), d = cal.getTimeInMillis()) { + String format = dateToDateString(new Date(d)); + result.add(format); + } + return result; + } } -- Gitblit v1.8.0