fix: use proper function head for default values with multiple clauses

This commit is contained in:
Graham McIntire 2026-01-18 12:41:39 -06:00
parent 139eb3b147
commit 442a79baa7
No known key found for this signature in database

View file

@ -108,9 +108,10 @@ defmodule ToweropsWeb.AgentLive.Helpers do
Returns strings like "5m ago (Jan 15, 2026 at 2:34 PM EST)".
"""
def format_last_seen_with_date(datetime, timezone \\ "UTC")
def format_last_seen_with_date(nil, _timezone), do: "Never"
def format_last_seen_with_date(datetime, timezone \\ "UTC") do
def format_last_seen_with_date(datetime, timezone) do
relative = format_last_seen(datetime)
full = format_datetime(datetime, timezone)
"#{relative} (#{full})"