diff options
| author | Fuwn <[email protected]> | 2025-07-11 09:31:37 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-07-11 09:31:37 -0700 |
| commit | bdda32dd6fdc38d552cccc5fa66e915db4742fd0 (patch) | |
| tree | 4caea46e78e7b3e4ee8c232e31107a7341904497 | |
| parent | docs(README): Add screenshot (diff) | |
| download | oguri-bdda32dd6fdc38d552cccc5fa66e915db4742fd0.tar.xz oguri-bdda32dd6fdc38d552cccc5fa66e915db4742fd0.zip | |
feat(schedule): Use day part for future airing times
| -rw-r--r-- | src/oguri/schedule.py | 3 |
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: |