Skip to content

Add monthly scheduling with set week [1st|2nd|3rd|4th|last]#92

Merged
dblock merged 1 commit intomainfrom
monthly-scheduling
Mar 10, 2026
Merged

Add monthly scheduling with set week [1st|2nd|3rd|4th|last]#92
dblock merged 1 commit intomainfrom
monthly-scheduling

Conversation

@dblock
Copy link
Owner

@dblock dblock commented Mar 10, 2026

Adds set week [1st|2nd|3rd|4th|last] to S'Up on the nth weekday of every month. Use unset week to revert to the weekly schedule. When monthly mode is active, sup_every_n_weeks is ignored.

Usage

@sup set week 2nd    # S'Up on the 2nd Monday of every month
@sup set week last   # S'Up on the last Monday of every month
@sup set week        # show current setting
@sup unset week      # revert to weekly schedule

Changes

  • lib/models/channel.rb: sup_week_of_month field (nil=weekly, 1–5), WEEK_OF_MONTH_ORDINALS lookup table, monthly_sup_date helper (handles "last" via end-of-month math), monthly-aware sup? and next_sup_at, display helpers sup_week_of_month_s and sup_schedule_s
  • lib/commands/set.rb: set_week_of_month, unset_week_of_month, wired into channel_set/channel_unset, channel_info now uses sup_schedule_s for both weekly and monthly modes
  • lib/api/presenters/channel_presenter.rb: exposes sup_week_of_month and sup_week_of_month_s
  • lib/commands/help.rb: documented set week and unset week
  • spec/models/channel_spec.rb: monthly sup? and next_sup_at tests including "last" weekday
  • spec/slack-sup/commands/set_spec_channel.rb: view/change/cannot-change tests for week
  • CHANGELOG.md: new entry

@dblock dblock force-pushed the monthly-scheduling branch 5 times, most recently from 5f4b43e to 7b32729 Compare March 10, 2026 20:29
Adds `set week [1st|2nd|3rd|4th|last]` to S'Up on the nth weekday of
every month (e.g. 2nd Monday). Use `unset week` to revert to the
weekly schedule. When monthly mode is active, `sup_every_n_weeks` is
ignored.

- Channel model: `sup_week_of_month` field (nil=weekly, 1–5), `WEEK_OF_MONTH_ORDINALS`
  lookup table, `monthly_sup_date` helper (handles "last" via end-of-month math),
  monthly-aware `sup?` and `next_sup_at`, display helpers `sup_week_of_month_s`
  and `sup_schedule_s`
- Commands: `set_week_of_month`, `unset_week_of_month`, wired into
  `channel_set`/`channel_unset`, `channel_info` uses `sup_schedule_s`
- API presenter: exposes `sup_week_of_month` and `sup_week_of_month_s`
- Help, changelog, and specs updated

Closes #40

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock dblock force-pushed the monthly-scheduling branch from 7b32729 to fc1e1c3 Compare March 10, 2026 20:38
@dblock dblock merged commit 0e837ba into main Mar 10, 2026
4 checks passed
@dblock dblock mentioned this pull request Mar 10, 2026
@dblock dblock deleted the monthly-scheduling branch March 12, 2026 23:12
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