mirror of
https://github.com/Sea-Haven-Industries/afterhours-shift-manager.git
synced 2026-09-30 11:23:12 +00:00
Show shift type label for both weekend shifts in notifications
Night shift notifications on weekends were missing the type label, making them ambiguous. Also fix schedule post text fallback to use this_monday instead of now for the start date.
This commit is contained in:
parent
98631a3b2f
commit
889a1b307c
2 changed files with 4 additions and 2 deletions
|
|
@ -131,7 +131,9 @@ def build_shift_change_message(
|
|||
dt = datetime.strptime(date_str, "%Y-%m-%d")
|
||||
day_label = dt.strftime("%A, %b %-d")
|
||||
type_label = (
|
||||
f" ({SHIFT_LABELS.get(shift_type, shift_type)})" if shift_type == "day" else ""
|
||||
f" ({SHIFT_LABELS.get(shift_type, shift_type)})"
|
||||
if dt.strftime("%A") in WEEKEND_DAYS
|
||||
else ""
|
||||
)
|
||||
|
||||
if action == "picked_up":
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ def create_app(
|
|||
channel=channel,
|
||||
ts=post["message_ts"],
|
||||
blocks=blocks,
|
||||
text=f"After-Hours Schedule — {now.strftime('%b %-d')} to {end_date.strftime('%b %-d')}",
|
||||
text=f"After-Hours Schedule — {this_monday.strftime('%b %-d')} to {end_date.strftime('%b %-d')}",
|
||||
)
|
||||
except Exception:
|
||||
logger.warning("Could not update schedule post", exc_info=True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue