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

DateTimePicker behaviors #495

Closed
Leomaradan opened this issue Mar 3, 2020 · 2 comments
Closed

DateTimePicker behaviors #495

Leomaradan opened this issue Mar 3, 2020 · 2 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release.
Milestone

Comments

@Leomaradan
Copy link
Contributor

Category

[ ] Enhancement

[X] Bug

[ ] Question

Version

Please specify what version of the library you are using: [1.16.0]

Observed Behavior

The DateTimePicker component does not have a homogeneous behavior with the onChange event. When entering a invalid value, the onChange event is triggered sometime with latest valid value, and sometime it return Invalid Date

Steps to Reproduce

I created a repository with a small webpart containing only the DateTimePicker and a onChange Handler
https://github.com/bpa-solutions/demo-webpart-datepicker

Steps:

  1. Place the WebPart on the page. picker date is empty, the picker hour is set to "12 AM" and the picker minute is set to "00"
  2. Click on the Date picker, and select the current date (03 March 2020) => the onChange event return "Tue, 03 Mar 2020 11:00:00 GMT"
  3. Change the Hour to "08 AM" => the onChange event return "Tue, 03 Mar 2020 07:00:00 GMT"
  4. Remove the Hour => the onChange event return the last valid value ("Tue, 03 Mar 2020 07:00:00 GMT")
  5. Set the Hour to "13 AM" => the onChange return "Tue, 03 Mar 2020 00:00:00 GMT", and a label "Incorrect hour value" is displayed under the Hour picker
  6. Set to a correct date (03 Mar 2020 21:00:00 GMT) and then remove the Minute part => the onChange return an invalid date, and the Date picker is now set to Invalid Date too!
  7. Click on the Date picker, and select any date => the new date is not set, because the Minute is empty

The component is stuck after the step 6. The user has to first set a new Minute value, and after that he can select a date again.

Desired Behavior

The Picker must either only return the last valid date, or not triggering the onChange.
The Picker must not be stuck. Changing the Minute must not change the Date to Invalid Date.
If a invalid minute is set, a error message must be displayed.

@ghost
Copy link

ghost commented Mar 3, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Mar 6, 2020

Fixed in the next drop

@AJIXuMuK AJIXuMuK added this to the 1.17.0 milestone Mar 6, 2020
@AJIXuMuK AJIXuMuK added status:fixed-next-drop Issue will be fixed in upcoming release. and removed Needs: Triage 🔍 labels Mar 6, 2020
@estruyf estruyf closed this as completed Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release.
Projects
None yet
Development

No branches or pull requests

3 participants