Australian Format DD/MM/YYYY is not working in Datepicker
Replicate the issue here https://codesandbox.io/s/0zpii?module=/example.js.
When I type an Australian date format in the inputbox, the calendar doesn't change. Meaning it is not working properly and will not trigger an On Change.
When I type using Australian Format, it should change the datepicker as well and trigger an onchange event.
I think this happens in all baseweb versions.
Thanks for the report, I was coincidentally just working on this issue. A fix should be up soon
oh cool, thank you Chase!
@ryshiselect
Try passing this as the prop formatString={'dd/MM/yyyy'} and you are good to go
I tried and it is working fine for me.
You can take the reference from this link - https://date-fns.org/v2.8.1/docs/format
@keshav-bohr , how did you do it? Do you click on the calendar? Or you input the date in the inputbox? You should input the date in the input box.
@ryshiselect
We are talking about to checks here.
One is from the user perspective, He/She should specify the formatString from their end.
Other is the issue here that we are talking about, onChange we are getting odd behaviour.
The second issue I am working on to fix.
As soon as my previous PR regarding the docs gets merged.
I can raise another one to fix the issue.
cc: @gergelyke @chasestarr
Ideally.
We should not be having input for the datepicker.
Since, we have so many options to choose from, https://date-fns.org/v2.8.1/docs/format
If we have to give the input facility, then we need to fix some predefined popular formats in a dropdown or something.
Like
If we can have these options predefined for the input, then we can change in the code replicate the input onChange requirement.
Otherwise, we cannot decide just on the basis of the formatString for the input field. There are literally thousands of options that we have
cc: @gergelyke @chasestarr @ryshiselect
fyi this is the fix that I mentioned earlier https://github.com/uber/baseweb/pull/2731/commits/20e4fecf6a1214947b158e1adc77d6a26023e968
Great.
This seems good.
thank you for the contribution
@chasestarr
Please let me know if i can help you in any other issue resolution.
I would be happy to help :)
Thanks
Thanks @keshav-bohr. We mark github issues with the help wanted tag if we think it's something that could use some help