Refactor date calculation methods in LayerUtil

class
This commit is contained in:
Simon Larsen 2023-12-03 15:38:11 +00:00
parent 57cc4edcca
commit 97a326cb51
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -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