Loading escheduler-common/src/main/java/cn/escheduler/common/utils/DependentUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,9 @@ public class DependentUtils { case "last7Days": result = DependentDateUtils.getLastDayInterval(businessDate, 7); break; case "thisWeek": result = DependentDateUtils.getThisWeekInterval(businessDate); break; case "lastWeek": result = DependentDateUtils.getLastWeekInterval(businessDate); break; Loading @@ -119,6 +122,9 @@ public class DependentUtils { case "lastSunday": result = DependentDateUtils.getLastWeekOneDayInterval(businessDate, 7); break; case "thisMonth": result = DependentDateUtils.getThisMonthInterval(businessDate); break; case "lastMonth": result = DependentDateUtils.getLastMonthInterval(businessDate); break; Loading escheduler-common/src/main/java/cn/escheduler/common/utils/dependent/DependentDateUtils.java +20 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,16 @@ public class DependentDateUtils { return dateIntervals; } /** * get interval between this month first day and businessDate * @param businessDate * @return */ public static List<DateInterval> getThisMonthInterval(Date businessDate) { Date firstDay = DateUtils.getFirstDayOfMonth(businessDate); return getDateIntervalListBetweenTwoDates(firstDay, businessDate); } /** * get interval between last month first day and last day * @param businessDate Loading Loading @@ -108,6 +118,16 @@ public class DependentDateUtils { } } /** * get interval between monday to businessDate of this week * @param businessDate * @return */ public static List<DateInterval> getThisWeekInterval(Date businessDate) { Date mondayThisWeek = DateUtils.getMonday(businessDate); return getDateIntervalListBetweenTwoDates(mondayThisWeek, businessDate); } /** * get interval between monday to sunday of last week * default set monday the first day of week Loading escheduler-common/src/test/java/cn/escheduler/common/utils/DependentUtilsTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,26 @@ public class DependentUtilsTest { Assert.assertEquals(dateIntervals.get(0), diCur); dateValue = "thisWeek"; Date firstWeekDay = DateUtils.getMonday(curDay); dateIntervals = DependentUtils.getDateIntervalList(curDay, dateValue); DateInterval weekHead = new DateInterval(DateUtils.getStartOfDay(firstWeekDay), DateUtils.getEndOfDay(firstWeekDay)); DateInterval weekThis = new DateInterval(DateUtils.getStartOfDay(curDay), DateUtils.getEndOfDay(curDay)); Assert.assertEquals(dateIntervals.get(0), weekHead); Assert.assertEquals(dateIntervals.get(dateIntervals.size() - 1), weekThis); dateValue = "thisMonth"; Date firstMonthDay = DateUtils.getFirstDayOfMonth(curDay); dateIntervals = DependentUtils.getDateIntervalList(curDay, dateValue); DateInterval monthHead = new DateInterval(DateUtils.getStartOfDay(firstMonthDay), DateUtils.getEndOfDay(firstMonthDay)); DateInterval monthThis = new DateInterval(DateUtils.getStartOfDay(curDay), DateUtils.getEndOfDay(curDay)); Assert.assertEquals(dateIntervals.get(0), monthHead); Assert.assertEquals(dateIntervals.get(dateIntervals.size() - 1), monthThis); } Loading escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js +8 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,10 @@ const dateValueList = { } ], 'week': [ { value: 'thisWeek', label: `${i18n.$t('ThisWeek')}` }, { value: 'lastWeek', label: `${i18n.$t('LastWeek')}` Loading Loading @@ -98,6 +102,10 @@ const dateValueList = { } ], 'month': [ { value: 'thisMonth', label: `${i18n.$t('ThisMonth')}` }, { value: 'lastMonth', label: `${i18n.$t('LastMonth')}` Loading escheduler-ui/src/js/module/i18n/locale/en_US.js +2 −0 Original line number Diff line number Diff line Loading @@ -395,6 +395,7 @@ export default { 'Last2Days': 'Last2Days', 'Last3Days': 'Last3Days', 'Last7Days': 'Last7Days', 'ThisWeek': 'ThisWeek', 'LastWeek': 'LastWeek', 'LastMonday': 'LastMonday', 'LastTuesday': 'LastTuesday', Loading @@ -403,6 +404,7 @@ export default { 'LastFriday': 'LastFriday', 'LastSaturday': 'LastSaturday', 'LastSunday': 'LastSunday', 'ThisMonth': 'ThisMonth', 'LastMonth': 'LastMonth', 'LastMonthBegin': 'LastMonthBegin', 'LastMonthEnd': 'LastMonthEnd', Loading Loading
escheduler-common/src/main/java/cn/escheduler/common/utils/DependentUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,9 @@ public class DependentUtils { case "last7Days": result = DependentDateUtils.getLastDayInterval(businessDate, 7); break; case "thisWeek": result = DependentDateUtils.getThisWeekInterval(businessDate); break; case "lastWeek": result = DependentDateUtils.getLastWeekInterval(businessDate); break; Loading @@ -119,6 +122,9 @@ public class DependentUtils { case "lastSunday": result = DependentDateUtils.getLastWeekOneDayInterval(businessDate, 7); break; case "thisMonth": result = DependentDateUtils.getThisMonthInterval(businessDate); break; case "lastMonth": result = DependentDateUtils.getLastMonthInterval(businessDate); break; Loading
escheduler-common/src/main/java/cn/escheduler/common/utils/dependent/DependentDateUtils.java +20 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,16 @@ public class DependentDateUtils { return dateIntervals; } /** * get interval between this month first day and businessDate * @param businessDate * @return */ public static List<DateInterval> getThisMonthInterval(Date businessDate) { Date firstDay = DateUtils.getFirstDayOfMonth(businessDate); return getDateIntervalListBetweenTwoDates(firstDay, businessDate); } /** * get interval between last month first day and last day * @param businessDate Loading Loading @@ -108,6 +118,16 @@ public class DependentDateUtils { } } /** * get interval between monday to businessDate of this week * @param businessDate * @return */ public static List<DateInterval> getThisWeekInterval(Date businessDate) { Date mondayThisWeek = DateUtils.getMonday(businessDate); return getDateIntervalListBetweenTwoDates(mondayThisWeek, businessDate); } /** * get interval between monday to sunday of last week * default set monday the first day of week Loading
escheduler-common/src/test/java/cn/escheduler/common/utils/DependentUtilsTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,26 @@ public class DependentUtilsTest { Assert.assertEquals(dateIntervals.get(0), diCur); dateValue = "thisWeek"; Date firstWeekDay = DateUtils.getMonday(curDay); dateIntervals = DependentUtils.getDateIntervalList(curDay, dateValue); DateInterval weekHead = new DateInterval(DateUtils.getStartOfDay(firstWeekDay), DateUtils.getEndOfDay(firstWeekDay)); DateInterval weekThis = new DateInterval(DateUtils.getStartOfDay(curDay), DateUtils.getEndOfDay(curDay)); Assert.assertEquals(dateIntervals.get(0), weekHead); Assert.assertEquals(dateIntervals.get(dateIntervals.size() - 1), weekThis); dateValue = "thisMonth"; Date firstMonthDay = DateUtils.getFirstDayOfMonth(curDay); dateIntervals = DependentUtils.getDateIntervalList(curDay, dateValue); DateInterval monthHead = new DateInterval(DateUtils.getStartOfDay(firstMonthDay), DateUtils.getEndOfDay(firstMonthDay)); DateInterval monthThis = new DateInterval(DateUtils.getStartOfDay(curDay), DateUtils.getEndOfDay(curDay)); Assert.assertEquals(dateIntervals.get(0), monthHead); Assert.assertEquals(dateIntervals.get(dateIntervals.size() - 1), monthThis); } Loading
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js +8 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,10 @@ const dateValueList = { } ], 'week': [ { value: 'thisWeek', label: `${i18n.$t('ThisWeek')}` }, { value: 'lastWeek', label: `${i18n.$t('LastWeek')}` Loading Loading @@ -98,6 +102,10 @@ const dateValueList = { } ], 'month': [ { value: 'thisMonth', label: `${i18n.$t('ThisMonth')}` }, { value: 'lastMonth', label: `${i18n.$t('LastMonth')}` Loading
escheduler-ui/src/js/module/i18n/locale/en_US.js +2 −0 Original line number Diff line number Diff line Loading @@ -395,6 +395,7 @@ export default { 'Last2Days': 'Last2Days', 'Last3Days': 'Last3Days', 'Last7Days': 'Last7Days', 'ThisWeek': 'ThisWeek', 'LastWeek': 'LastWeek', 'LastMonday': 'LastMonday', 'LastTuesday': 'LastTuesday', Loading @@ -403,6 +404,7 @@ export default { 'LastFriday': 'LastFriday', 'LastSaturday': 'LastSaturday', 'LastSunday': 'LastSunday', 'ThisMonth': 'ThisMonth', 'LastMonth': 'LastMonth', 'LastMonthBegin': 'LastMonthBegin', 'LastMonthEnd': 'LastMonthEnd', Loading