box-ui-elements
box-ui-elements copied to clipboard
DatePicker isTextInputAllowed doesn't work with i10n
In some languages, the day and month are reversed, and so when this is converted to a new Date() it sets the incorrect date in the UI. Example in German: September 7, 2019 would do new Date('7.9.2019') which would create a JS object for July 9, 2019 and set the date in the text field as such. This affects calendar selection and freeform text input upon blur of text field.
We should update the DatePicker input field so that the input isn't so freeform, but rather divided into 3 separate fields so that we can distinguish which part is the month, day, and year. This would have the benefit of giving the user an indication of the expected format and prevent them from inputing invalid data.