mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 07:42:10 +00:00
Refactor date calculation methods in LayerUtil
class
This commit is contained in:
parent
57cc4edcca
commit
97a326cb51
@ -233,7 +233,7 @@ export default class LayerUtil {
|
|||||||
if(data.rotation.intervalType === EventInterval.Day){
|
if(data.rotation.intervalType === EventInterval.Day){
|
||||||
|
|
||||||
intervalBetweenStartTimeAndHandoffTime =
|
intervalBetweenStartTimeAndHandoffTime =
|
||||||
OneUptimeDate.getDaysBetweenTwoDatesInclusive(
|
OneUptimeDate.getDaysBetweenTwoDates(
|
||||||
handOffTime,
|
handOffTime,
|
||||||
data.currentEventStartTime
|
data.currentEventStartTime
|
||||||
);
|
);
|
||||||
@ -259,7 +259,7 @@ export default class LayerUtil {
|
|||||||
if(data.rotation.intervalType === EventInterval.Hour){
|
if(data.rotation.intervalType === EventInterval.Hour){
|
||||||
|
|
||||||
intervalBetweenStartTimeAndHandoffTime =
|
intervalBetweenStartTimeAndHandoffTime =
|
||||||
OneUptimeDate.getHoursBetweenTwoDatesInclusive(
|
OneUptimeDate.getHoursBetweenTwoDates(
|
||||||
handOffTime,
|
handOffTime,
|
||||||
data.currentEventStartTime
|
data.currentEventStartTime
|
||||||
);
|
);
|
||||||
@ -284,7 +284,7 @@ export default class LayerUtil {
|
|||||||
if(data.rotation.intervalType === EventInterval.Week){
|
if(data.rotation.intervalType === EventInterval.Week){
|
||||||
|
|
||||||
intervalBetweenStartTimeAndHandoffTime =
|
intervalBetweenStartTimeAndHandoffTime =
|
||||||
OneUptimeDate.getWeeksBetweenTwoDatesInclusive(
|
OneUptimeDate.getWeeksBetweenTwoDates(
|
||||||
handOffTime,
|
handOffTime,
|
||||||
data.currentEventStartTime
|
data.currentEventStartTime
|
||||||
);
|
);
|
||||||
@ -310,7 +310,7 @@ export default class LayerUtil {
|
|||||||
if(data.rotation.intervalType === EventInterval.Month){
|
if(data.rotation.intervalType === EventInterval.Month){
|
||||||
|
|
||||||
intervalBetweenStartTimeAndHandoffTime =
|
intervalBetweenStartTimeAndHandoffTime =
|
||||||
OneUptimeDate.getMonthsBetweenTwoDatesInclusive(
|
OneUptimeDate.getMonthsBetweenTwoDates(
|
||||||
handOffTime,
|
handOffTime,
|
||||||
data.currentEventStartTime
|
data.currentEventStartTime
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ export default class LayerUtil {
|
|||||||
if(data.rotation.intervalType === EventInterval.Year){
|
if(data.rotation.intervalType === EventInterval.Year){
|
||||||
|
|
||||||
intervalBetweenStartTimeAndHandoffTime =
|
intervalBetweenStartTimeAndHandoffTime =
|
||||||
OneUptimeDate.getYearsBetweenTwoDatesInclusive(
|
OneUptimeDate.getYearsBetweenTwoDates(
|
||||||
handOffTime,
|
handOffTime,
|
||||||
data.currentEventStartTime
|
data.currentEventStartTime
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user