aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-07-11 09:31:37 -0700
committerFuwn <[email protected]>2025-07-11 09:31:37 -0700
commitbdda32dd6fdc38d552cccc5fa66e915db4742fd0 (patch)
tree4caea46e78e7b3e4ee8c232e31107a7341904497 /src
parentdocs(README): Add screenshot (diff)
downloadoguri-bdda32dd6fdc38d552cccc5fa66e915db4742fd0.tar.xz
oguri-bdda32dd6fdc38d552cccc5fa66e915db4742fd0.zip
feat(schedule): Use day part for future airing times
Diffstat (limited to 'src')
-rw-r--r--src/oguri/schedule.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/oguri/schedule.py b/src/oguri/schedule.py
index a900294..32efb8b 100644
--- a/src/oguri/schedule.py
+++ b/src/oguri/schedule.py
@@ -203,11 +203,14 @@ def format_exact_time(date):
def format_future_airing_time(date, now):
delta = date - now
hours, remainder = divmod(int(delta.total_seconds()), 3600)
+ days, hours = divmod(hours, 24)
minutes, _ = divmod(remainder, 60)
time_string = date.strftime("%I:%M %p").replace("AM",
"a.m.").replace("PM", "p.m.")
parts = []
+ if days > 0:
+ parts.append(f"{days}d")
if hours > 0:
parts.append(f"{hours}h")
if minutes > 0: