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

[Enhancement] Update DatePicker and TimePicker to use DateOnly and TimeOnly structs #1847

Closed
Dreamescaper opened this issue Jul 28, 2021 · 7 comments
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor t/enhancement ☀️ New feature or request

Comments

@Dreamescaper
Copy link

Summary

Recently added DateOnly and TimeOnly structs seem like a much better fit for DatePicker and TimePicker contols.
Although I'm not sure whether such breaking change (comparing to Xamarin.Forms) is allowed.

API Changes

Update DatePicker's properties to have DateOnly types:

  • MinimumDate
  • MaximumDate
  • Date

Update TimePicker's properties to have TimeOnly types:

  • Time
@hartez
Copy link
Contributor

hartez commented Aug 3, 2021

For reference: dotnet/runtime#50980

@davidbuckleyni
Copy link

I think to they need think viusally how this works like if date only in the model the time picker element in the picker shoud disappear and vice versus

@Dreamescaper
Copy link
Author

@davidbuckleyni
There is no time picker DatePicker, and no date picker in TimePicker, those are two separate components. So I'm not sure what do you mean?

@davidbuckleyni
Copy link

@davidbuckleyni

There is no time picker DatePicker, and no date picker in TimePicker, those are two separate components. So I'm not sure what do you mean?

If someone described time only for example in the model i would expect only s time picker to be displayed if they had date only then the just the date. If that the case then why mention time only

@Dreamescaper
Copy link
Author

Sorry, I'm not following :(

Currently DatePicker control uses DateTime type for properties. But even though DateTime has both date and time components, DatePicker allows you to select date only.

My suggestion is to use DateOnly type to reflect that.

Similar situation with TimePicker control, which currently uses TimeSpan type.

@jsuarezruiz jsuarezruiz added the t/enhancement ☀️ New feature or request label Oct 25, 2021
@hartez hartez added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Nov 5, 2021
@Redth
Copy link
Member

Redth commented Nov 15, 2021

Let's make Core only have the Date / Time parts as appropriate, and then keep the old DateTime in both on the Controls level and just have it wrap the Date/Time only.

@Redth
Copy link
Member

Redth commented Nov 16, 2021

Closing in favour of the updated spec in #1100 which takes care of this and nullable.

@Redth Redth closed this as completed Nov 16, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor t/enhancement ☀️ New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants