Skip to content

DatePicker - #33

Merged
colemancda merged 4 commits into
masterfrom
feature/datepicker
Jul 23, 2026
Merged

DatePicker#33
colemancda merged 4 commits into
masterfrom
feature/datepicker

Conversation

@colemancda

Copy link
Copy Markdown
Member

Completes the controls tier: a date picker bound to a Foundation Date.

What's new

  • DatePickerDatePicker("Title", selection: $date) with Binding<Date> (Foundation's Date; the core now imports Foundation rather than defining its own date type). The selection crosses the bridge as milliseconds since the Unix epoch — Compose DatePickerState's native currency — so the conversion is a single multiply on each side.
  • Interpreter renders a label row with a trailing formatted date (Jan 15, 2000); tapping opens a Material3 DatePickerDialog, and confirming fires the double callback with the picked millis.

Verification

  • swift test — DatePicker emission + round-trip test (invoking the change callback updates the emitted millis), 53 total passing
  • Emulator (More Controls screen): row shows Jan 1, 2000 from the initial Date; tapping opens the calendar dialog seeded to January 2000 with day 1 selected; picking 15 and confirming updates the row to Jan 15, 2000 — full state round-trip through @State var birthday: Date

Notes

Date-only (UTC midnight semantics, matching the Material date picker); displayedComponents/time selection not modeled. Dialog date formatting is a fixed MMM d, yyyy-style abbreviation, locale-neutral for now.

@colemancda
colemancda merged commit 0e7db5c into master Jul 23, 2026
6 checks passed
@colemancda
colemancda deleted the feature/datepicker branch July 23, 2026 14:14
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