Fixed formatting for the pushover serivice
This commit is contained in:
@@ -204,10 +204,23 @@ class PushoverService:
|
||||
start = period.get("start", "")
|
||||
end = period.get("end", "")
|
||||
if start and end:
|
||||
# Extract just the time portion
|
||||
start_time = start.split(" ")[1] if " " in start else start
|
||||
end_time = end.split(" ")[1] if " " in end else end
|
||||
lines.append(f"Period: {start_time} - {end_time}")
|
||||
# Parse the datetime strings to check if they're on different days
|
||||
if " " in start and " " in end:
|
||||
start_date, start_time = start.split(" ")
|
||||
end_date, end_time = end.split(" ")
|
||||
|
||||
# If same day, just show times
|
||||
if start_date == end_date:
|
||||
lines.append(f"Period: {start_time} - {end_time}")
|
||||
else:
|
||||
# Different days, show date + time in compact format
|
||||
# Format: "MM-DD HH:MM - MM-DD HH:MM"
|
||||
start_compact = f"{start_date[5:]} {start_time[:5]}"
|
||||
end_compact = f"{end_date[5:]} {end_time[:5]}"
|
||||
lines.append(f"Period: {start_compact} - {end_compact}")
|
||||
else:
|
||||
# Fallback if format is unexpected
|
||||
lines.append(f"Period: {start} - {end}")
|
||||
|
||||
# Total reservations
|
||||
total = stats.get("total_reservations", 0)
|
||||
|
||||
Reference in New Issue
Block a user