XAML DatePicker Control Does Not Update DateOnly Items #20438
Labels
area-controls-datetimepicker
DatePicker, TimePicker
area-xaml
XAML, CSS, Triggers, Behaviors
platform/android 🤖
platform/windows 🪟
t/bug
Something isn't working
Description
If you use a DatePicker control with a bi-directionall binding to a DateOnly object it will fail to update the object when a new date is selected. On Windows it emits the message
Microsoft.Maui.Controls.Xaml.Diagnostics.BindingDiagnostics: Warning: '02/08/2024 00:00:00' cannot be converted to type 'System.DateOnly'
Steps to Reproduce
If you change the DateOnly items into DateTime items the problem goes away.
Link to public reproduction project repository
https://github.com/david-maw/OnePage-DateOnly.git
Version with bug
8.0.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Windows 11, Android 14
Did you find any workaround?
On the face of it a converter looks like it would be an easy workaround but I have not needed to try it.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: