Skip to content

v3.0.0 — DayComponents and SwiftData compatibility#11

Merged
drekka merged 3 commits intomainfrom
develop
Mar 7, 2026
Merged

v3.0.0 — DayComponents and SwiftData compatibility#11
drekka merged 3 commits intomainfrom
develop

Conversation

@drekka
Copy link
Owner

@drekka drekka commented Mar 7, 2026

Summary

  • Day now has a single stored property (daysSince1970) to prevent SwiftData decomposing it into multiple database columns
  • Reintroduced DayComponents struct with year, month, dayOfMonth — accessed via Day.dayComponents computed property
  • CalendarDays values changed from [Day] to [DayComponents] for efficient calendar rendering
  • Added init(_ dayComponents:) initialiser
  • Removed direct year, month, dayOfMonth properties from Day

Breaking changes

  • day.year / day.month / day.dayOfMonthday.dayComponents.year etc.
  • CalendarDays is now OrderedDictionary<Day, [DayComponents]>
  • DayComponents.day renamed to DayComponents.dayOfMonth

Test plan

  • All 98 tests pass via swift test
  • Calendar grid generation verified with DayComponents values
  • README and CLAUDE.md updated

🤖 Generated with Claude Code

drekka and others added 3 commits March 4, 2026 18:54
…y, fix macro deprecations

- Day init(year:month:day:) now throws DayError for invalid inputs
- Day stores year, month, dayOfMonth directly alongside daysSince1970
- Removed DayComponents and CalendarDay — CalendarDays is now
  OrderedDictionary<Day, [Day]>
- Fixed deprecated MemberMacro expansion signatures (added conformingTo)
- Updated README and CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Month and year rolling now uses modular arithmetic to calculate the
target month/year, then clamps the day to the last day of that month.
This means Jan 31 + 1 month = Feb 28 (or 29) instead of overshooting
into March, and Feb 29 + 1 year = Feb 28 in non-leap years.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ility

Day now has a single stored property (daysSince1970) to prevent SwiftData
decomposing it into multiple columns. Year, month, and dayOfMonth are
accessed via the dayComponents computed property. CalendarDays values
changed from [Day] to [DayComponents].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@drekka drekka merged commit 9af6e13 into main Mar 7, 2026
2 checks passed
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