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

(GH-3746) Fix Date and Time selection and other improvements for DateTimePicker #3775

Merged
merged 16 commits into from
May 6, 2020

Conversation

timunie
Copy link
Collaborator

@timunie timunie commented Apr 16, 2020

Describe the changes you have made to improve this project

  • Fix input for date and time text input for DateTimePicker
    • if the Time is selected before a Date is selected use DateTime.Today instead of DateTime.Min
    • If a new Value is selected from the Calendar we use the already Selected time.
  • Use PopupEx to fix position change for floating watermark
  • Fix wrong focus for popup content
  • Fix closing (unfocusing) and opening PopUp
  • Fix capturing CalendarItem
  • Add key processing if Popup is open
  • Add DisplayDateChanged event handling
  • Respect IsEnabledProperty
  • Remove TimePickerBaseSelectionChangedEventArgs and use RoutedPropertyChangedEventHandler and RoutedPropertyChangedEventArgs
  • Set selected date and time from textbox

Unit test

DateTimePickerTests

Additional context

There is one issue left where I have no idea how to solve this: If the user inserts a new DateTime manually where the time is 00:00:00 the time might get overridden with the last used time. I think this case is rather rare, but should be considered anyway.

Closed Issues

Closes #3746

@timunie timunie changed the title Some improvements to the DateTimePicker [WIP] Some improvements to the DateTimePicker Apr 17, 2020
@timunie timunie changed the title [WIP] Some improvements to the DateTimePicker Some improvements to the DateTimePicker Apr 17, 2020
@punker76 punker76 changed the title Some improvements to the DateTimePicker (GH-3746) Fix Date and Time selection and other improvements for DateTimePicker Apr 19, 2020
@punker76 punker76 added this to the 2.0.0 milestone Apr 19, 2020
@timunie
Copy link
Collaborator Author

timunie commented Apr 22, 2020

@punker76 can we change TimePickerBaseSelectionChangedEventArgs to GenericSelectionChangedEventArgs? We then could reuse it e.g. for the ColorPicker. It is already generic, just the name does not say it :-)

Have a great day
Tim

@punker76 punker76 changed the title (GH-3746) Fix Date and Time selection and other improvements for DateTimePicker WIP (GH-3746) Fix Date and Time selection and other improvements for DateTimePicker Apr 22, 2020
@punker76 punker76 force-pushed the DateTimePicker_Fix branch 3 times, most recently from d6e81f8 to fe89f21 Compare April 29, 2020 21:43
@punker76
Copy link
Member

@punker76 can we change TimePickerBaseSelectionChangedEventArgs to GenericSelectionChangedEventArgs? We then could reuse it e.g. for the ColorPicker. It is already generic, just the name does not say it :-)

Have a great day
Tim

@timunie You can use the RoutedPropertyChangedEventHandler and RoutedPropertyChangedEventArgs which are generic classes. I removed the TimePickerBaseSelectionChangedEventArgs because we don't need them.

@timunie
Copy link
Collaborator Author

timunie commented Apr 30, 2020

Thank you for the info. I wil use this instead

@punker76 punker76 changed the title WIP (GH-3746) Fix Date and Time selection and other improvements for DateTimePicker (GH-3746) Fix Date and Time selection and other improvements for DateTimePicker May 6, 2020
@punker76 punker76 merged commit 83fc0d8 into MahApps:develop May 6, 2020
@timunie timunie deleted the DateTimePicker_Fix branch May 7, 2020 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

DateTimePicker changes date to 1/1/0001 when selecting time first
2 participants