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

[DatePicker]: When typing date range picker chooses invalid date #3832

Closed
scottdickerson opened this issue Aug 26, 2019 · 12 comments
Closed

Comments

@scottdickerson
Copy link
Contributor

If we are editing the date and it's showing 08/03/2019. when we show 08/0/2019 in the date picker, the range switches to July 31st. It shouldn't update since 08/0/2019 is an invalid date

image

@scottdickerson
Copy link
Contributor Author

I tested in the latest version of Carbon, and received similar results if I hit the enter button in this state

@asudoh
Copy link
Contributor

asudoh commented Aug 27, 2019

Hi 👋 thank you for reporting - A quick question, is this against our vanilla variant or against our React variant?

@scottdickerson
Copy link
Contributor Author

this happens in both, I think it is related to flatpickr

@tw15egan
Copy link
Collaborator

Perhaps we should bring this to their attention and see if this is working as they intended or it is a bug

@asudoh
Copy link
Contributor

asudoh commented Aug 30, 2019

@scottdickerson Do you see the issue at http://react.carbondesignsystem.com/?path=/story/datepicker--single-with-calendar or https://the-carbon-components.netlify.com/component/date-picker--single.html? I'm asking this because I couldn't see the problem at neither of them. Thanks!

@scottdickerson
Copy link
Contributor Author

I do, if you're looking at August in the calendar, type 08/0/2019 and hit enter you'll see it switch

@asudoh
Copy link
Contributor

asudoh commented Sep 2, 2019

Thanks @scottdickerson. I see enter key is the trigger. Reported at flatpickr/flatpickr#1927.

@georginaso
Copy link

@asudoh The problem is not only happening if you set an invalid date.
If you write a valid date in the input (different that the selected in the DatePicker), the date is shown in the input, but the value it's not shown in the DatePicker until you press the enter key.
You can close and open the DatePicker many times but never gets the value if you don't press enter.

@asudoh
Copy link
Contributor

asudoh commented Jan 16, 2020

You are right @georginaso for the additional scenario. As mentioned, it's how Flatpickr works. That said, if the Flatpickr author sees many requests for "update-date-as-blur" or a like, e.g. by adding 👍 to flatpickr/flatpickr#1927 flatpickr/flatpickr#1551, things may change. Hesitant of getting around the Flatpickr behavior for the same reason, but reconsideration may happen if we see many 👍s to this issue (description).

@georginaso
Copy link

@asudoh There is a related issue already reported on the Flatpickr repo, but don't seem that they are going to fix it 😞: flatpickr/flatpickr#1551

@aledavila
Copy link
Contributor

Closing this as it seems its a Flatpickr issue and not an issue on our end.

@MohummedAbdullah
Copy link

Screenshot from 2022-08-05 12-12-55
On selecting same end date and start date it shows invalid date.


Date Range:  
<DateRangePicker
startDate={startDate}
startDateId="cus-inquiry-filter-start-date"
endDate={endDate}
endDateId="cus-inquiry-filter-end-date"
onDatesChange={({ startDate, endDate }) => {
handleChangeDates(startDate, endDate);
}}
focusedInput={focusedInput}
onFocusChange={handleChangeFocusedInput}
isOutsideRange={() => false}
/>

If anyone has some idea about that please do help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

7 participants