Skip to content

Commit

Permalink
Change x y to start end
Browse files Browse the repository at this point in the history
  • Loading branch information
topher-lo committed Nov 25, 2024
1 parent 0d57c66 commit 4b8690f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tracecat/expressions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4b8690f

Please sign in to comment.