fix: offset for rule evaluations

This commit is contained in:
Chris Anderson 2025-07-18 09:11:58 -05:00
parent 5e50931fb7
commit 68090d76f1

View file

@ -98,8 +98,9 @@ export const dateFromPeriod = (period: EventRulePeriod): { start_date: Date, end
month: 30 * 24 * 60 * 60,
year: 365 * 24 * 60 * 60,
}
const offset = period.value * intervals[period.unit]
return {
start_date: subSeconds(Date.now(), intervals[period.unit]),
start_date: subSeconds(Date.now(), offset),
}
}