Skip to content
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

XAML DatePicker Control Does Not Update DateOnly Items #20438

Closed
david-maw opened this issue Feb 8, 2024 · 2 comments · May be fixed by #21989
Closed

XAML DatePicker Control Does Not Update DateOnly Items #20438

david-maw opened this issue Feb 8, 2024 · 2 comments · May be fixed by #21989
Labels
area-controls-datetimepicker DatePicker, TimePicker area-xaml XAML, CSS, Triggers, Behaviors platform/android 🤖 platform/windows 🪟 t/bug Something isn't working

Comments

@david-maw
Copy link

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

  1. Clone the repo
  2. Build and run the app on Windows
  3. Select a new date in the UI
  4. Note that instead of the message coded into the app, 'set' is never called and the error message above is generated.

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

@david-maw david-maw added the t/bug Something isn't working label Feb 8, 2024
@jsuarezruiz jsuarezruiz added area-xaml XAML, CSS, Triggers, Behaviors area-controls-datetimepicker DatePicker, TimePicker labels Feb 8, 2024
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Feb 8, 2024
@PureWeen
Copy link
Member

PureWeen commented Feb 8, 2024

Duplicate of #1100

@PureWeen PureWeen marked this as a duplicate of #1100 Feb 8, 2024
@PureWeen PureWeen closed this as completed Feb 8, 2024
@david-maw
Copy link
Author

david-maw commented Feb 8, 2024

@PureWeen - Well, #1100 is an enhancement but this sure smells like a bug to me. Strikes me that fixing this narrow problem is a lot simpler than doing the larger enhancement in #1100 but either way, I've done my due diligence and reported it, sorry I didn't notice the original one.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2024
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-datetimepicker DatePicker, TimePicker area-xaml XAML, CSS, Triggers, Behaviors platform/android 🤖 platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants