box / box/box-ui-elements

DatePicker isTextInputAllowed doesn't work with i10n

Open
#1,542 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
551
Forks
351
Avg merge
5d 9h
Merged PRs (30d)
31

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.