Skip to content

feat: add :day unit to Offset.shift/3#36

Merged
hopsor merged 1 commit intomainfrom
feat-offset-shift-days
Mar 19, 2026
Merged

feat: add :day unit to Offset.shift/3#36
hopsor merged 1 commit intomainfrom
feat-offset-shift-days

Conversation

@hopsor
Copy link
Copy Markdown
Owner

@hopsor hopsor commented Mar 18, 2026

Summary

  • Add :day unit support to Offset.shift/3 for business day arithmetic (e.g. {3, :day} for "3 business days from now")
  • Preserves time of day on the target business day when possible; snaps to nearest business moment when the time doesn't fit (matching zendesk/biz behavior)
  • Uses TimeSlot.stream_next/3 and stream_previous/3 to count business days, keeping Offset's dependencies minimal (Schedule + TimeSlot only)
  • 17 new tests covering forward/backward shifts, holidays, weekends, multi-day spans, and snapping edge cases

🤖 Generated with Claude Code

Support shifting by business days with time-of-day preservation.
Uses TimeSlot.stream_next/3 and stream_previous/3 to count business
days, and snaps to the nearest business moment when the original
time doesn't fit on the target day.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hopsor hopsor force-pushed the feat-offset-shift-days branch from e09e0d1 to 5f61348 Compare March 18, 2026 23:12
@hopsor hopsor merged commit 3383599 into main Mar 19, 2026
3 checks passed
@hopsor hopsor deleted the feat-offset-shift-days branch March 19, 2026 10:38
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