Skip to content

Ensure deadline always falls on a weekday - #2

Open
sven1103 wants to merge 1 commit into
mainfrom
fix/weekday-deadline
Open

Ensure deadline always falls on a weekday#2
sven1103 wants to merge 1 commit into
mainfrom
fix/weekday-deadline

Conversation

@sven1103

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the issue where the ICS calendar deadline could fall on a weekend, making it invisible to colleagues who don't work on weekends.

Changes

  • Add is_weekend() helper function to check if a date is Saturday (5) or Sunday (6)
  • Add next_weekday() function to shift weekend dates to the following Monday
  • Modify build_deadline() to enforce minimum 3 working days (instead of potentially 2)
  • Modify build_deadline() to adjust the calculated deadline if it falls on a weekend

Test case

Release Date Calculated Adjusted
2026-04-22 (Wed) + 4 days = Sun Apr 26 Monday Apr 27
2026-04-23 (Thu) + 4 days = Mon Apr 27 No change needed
2026-04-24 (Fri) + 4 days = Tue Apr 28 No change needed

This ensures calendar reminders are always visible to colleagues on working days.

- Add is_weekend() helper to check if date is Sat/Sun
- Add next_weekday() to shift weekend dates to following Monday
- Modify build_deadline() to enforce minimum 3 working days
- Modify build_deadline() to adjust deadline if it falls on a weekend

This ensures ICS calendar reminders are always scheduled on working days
(Monday-Friday), not on weekends when colleagues are not working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant