Skip to content

Conversation

@bbrk24
Copy link
Contributor

@bbrk24 bbrk24 commented Nov 6, 2025

Fixes #233

Each backend has its own shortcomings:

  • UIKitBackend has weird availability constraints on each picker style, doesn't support hourMinuteAndSecond, and doesn't respect font color
    • Furthermore, UIDatePicker doesn't exist on tvOS
  • AppKitBackend doesn't support the wheel picker style
  • WinUIBackend doesn't support hourMinuteAndSecond, doesn't respect font color, and doesn't respect environment.timeZone (instead always using the current time zone)
  • GtkBackend only supports the graphical picker style, doesn't respect environment.timeZone (instead always using UTC), and only supports picking the date, not the time
  • Gtk3Backend is unimplemented as I have no way to test it.

@bbrk24
Copy link
Contributor Author

bbrk24 commented Nov 6, 2025

The thought just occurred to me to observe NSSystemTimeZoneDidChange to properly redraw views that use @Environment(\.timeZone), but I'm unsure how that would work, and regardless I don't see an equivalent for the calendar.

@stackotter
Copy link
Owner

There’s a backend method called setEnvironmentChangeHandler or something like that. That’s where we currently observe system theme changes and would be where timezone observation should live as well.

@bbrk24
Copy link
Contributor Author

bbrk24 commented Nov 7, 2025

Right, I'll go see if I can get that to work in UIKitBackend and AppKitBackend first, and then maybe the other backends. I don't think it'll necessarily work on Linux though

@bbrk24 bbrk24 marked this pull request as draft November 7, 2025 18:53
@bbrk24
Copy link
Contributor Author

bbrk24 commented Nov 7, 2025

Marking this as draft because UIDatePicker (at least on iOS 17) completely misbehaves if the user changes the time zone in settings

@bbrk24 bbrk24 marked this pull request as ready for review November 8, 2025 00:34
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.

Date Picker

2 participants