Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/src/util/reddit-freebuff-retention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type FreebuffRedditConversionPlan = {
function daysBetween(fromDateKey: string, toDateKey: string): number {
const from = new Date(`${fromDateKey}T00:00:00.000Z`).getTime()
const to = new Date(`${toDateKey}T00:00:00.000Z`).getTime()
if (Number.isNaN(from) || Number.isNaN(to)) {
if (!Number.isFinite(from) || !Number.isFinite(to)) {
throw new Error(`Invalid date key range: ${fromDateKey} -> ${toDateKey}`)
}
return Math.round((to - from) / DAY_MS)
Expand Down
Loading