Skip to content

Commit

Permalink
fixes lookback time
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Dec 3, 2021
1 parent 33f97ec commit 5aaf91f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export const formatPreviewRule = ({
description: 'Preview Rule',
};
const scheduleStepData = {
from: `now-${timeFrame === 'w' ? '604830' : timeFrame === 'd' ? '86420' : '3610'}s`,
from: `now-${timeFrame === 'M' ? '25h' : timeFrame === 'd' ? '65m' : '6m'}`,
interval: `${timeFrame === 'M' ? '1d' : timeFrame === 'd' ? '1h' : '5m'}`,
};
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const previewRulesRoute = async (

const startedAt = moment();
const parsedDuration = parseDuration(internalRule.schedule.interval) ?? 0;
startedAt.subtract(moment.duration(parsedDuration * invocationCount));
startedAt.subtract(moment.duration(parsedDuration * (invocationCount - 1)));

let previousStartedAt = null;

Expand Down

0 comments on commit 5aaf91f

Please sign in to comment.