mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-09-01 12:26:08 +08:00
fix: offset for rule evaluations
This commit is contained in:
parent
5e50931fb7
commit
68090d76f1
1 changed files with 2 additions and 1 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue