From 4b8690f7afa24045332ef2b62635217f4e674a34 Mon Sep 17 00:00:00 2001 From: topher-lo <46541035+topher-lo@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:33:24 -0800 Subject: [PATCH] Change x y to start end --- tracecat/expressions/functions.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tracecat/expressions/functions.py b/tracecat/expressions/functions.py index d80fb46ba..658a90250 100644 --- a/tracecat/expressions/functions.py +++ b/tracecat/expressions/functions.py @@ -527,29 +527,29 @@ def create_weeks(x: int) -> timedelta: return timedelta(weeks=x) -def seconds_between(x: datetime, y: datetime) -> float: +def seconds_between(start: datetime, end: datetime) -> float: """Seconds between two datetimes.""" - return (x - y).total_seconds() + return (end - start).total_seconds() -def minutes_between(x: datetime, y: datetime) -> float: +def minutes_between(start: datetime, end: datetime) -> float: """Minutes between two datetimes.""" - return (x - y).total_seconds() / 60 + return (end - start).total_seconds() / 60 -def hours_between(x: datetime, y: datetime) -> float: +def hours_between(start: datetime, end: datetime) -> float: """Hours between two datetimes.""" - return (x - y).total_seconds() / 3600 + return (end - start).total_seconds() / 3600 -def days_between(x: datetime, y: datetime) -> float: +def days_between(start: datetime, end: datetime) -> float: """Days between two datetimes.""" - return (x - y).total_seconds() / 86400 + return (end - start).total_seconds() / 86400 -def weeks_between(x: datetime, y: datetime) -> float: +def weeks_between(start: datetime, end: datetime) -> float: """Weeks between two datetimes or dates.""" - return (x - y).total_seconds() / 604800 + return (end - start).total_seconds() / 604800 def to_date_string(x: datetime, format: str) -> str: