New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to DateOnly and TimeOnly Types in Pickers #7364
Comments
It won't break anything, if we add additional property for that. Moreover, next major release would be right time to do it, and not wait for .NET 7/8. Old property can be deprecated.
Or this (with breaking change, but easy workaround):
What is true that we definitely can't remove old TimeSpan/DateTime properties. It's pure pain, when two different targets of the same version have two API sets with same naming but different types. |
I personally would prefer new SelectedTimeOnly and SelectedDateOnly properties |
Though, on a second though, it would require quite a lot of API to duplicate. There also a DisplayDateStart, DisplayDateEnd and same for time picker. Not to mention internal logic should use new types where possible and fallback to old types on older targets. |
We dare not duplicate the API and create new properties. This needs to be a clean breaking changes that: 1. Simplifies usage (important) and 2. Prevents possible time zone errors 3. Modernizes types. I was clear this might not be possible for some time. But when we are ready to set .net 6 as minimum it should be done. |
Describe the feature you'd like
The DatePicker and TimePicker could be switched over to the new .NET 6 types for DateOnly and TimeOnly. Especially for the DatePicker, this could eliminate some potential issues with
DateTimeOffset
unexpectedly using certain time zone values.As this would break existing apps and require .NET6, this should not be done for a few years. Perhaps around .NET 7/8 it would make sense to switch corresponding to the next major release of Avalonia that allows breaking changes.
Affected controls:
Describe alternatives you've considered
Additional context
Date, Time, and Time Zone Enhancements in .NET 6
The text was updated successfully, but these errors were encountered: