Skip to content

Commit

Permalink
clarify check
Browse files Browse the repository at this point in the history
  • Loading branch information
drewdaemon committed Dec 19, 2023
1 parent eea236f commit f051cb6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export type ExpressionFunctionFormulaTimeRange = ExpressionFunctionDefinition<

const getTimeRangeAsNumber = (timeRange: TimeRange | undefined, now: number | undefined) => {
if (!timeRange) return 0;
const absoluteTimeRange = getAbsoluteTimeRange(timeRange, now ? { forceNow: new Date(now) } : {});
const absoluteTimeRange = getAbsoluteTimeRange(
timeRange,
now != null ? { forceNow: new Date(now) } : {}
);
return timeRange ? moment(absoluteTimeRange.to).diff(moment(absoluteTimeRange.from)) : 0;
};

Expand Down

0 comments on commit f051cb6

Please sign in to comment.