grommet-controls icon indicating copy to clipboard operation
grommet-controls copied to clipboard

DateInput maskFormat and cal picking produce an error

Open cscognamiglio opened this issue 6 years ago • 4 comments

If I specify an alternative maskFormat from the defaule, as in the example below, I get an error if I use the datepicker and I select a day that is above 12. If I select a day before 12 the date is in the wrong format (i.e. mm dd yyyy).

Manual input of the date with autocorrect enabled works correctly.

<DateInput placeholder="JJ/MM/AAAA" autocorrect={true} maskFormat="dd mm yyyy" locale="fr-FR" value={resource.date_to} onChange={({ target: { value } }) => this.handleChange('date_to', value)} />

The exception is not very meaningful, it happens in the MaskedInput component and it is: TypeError: s is undefined

cscognamiglio avatar Oct 07 '19 11:10 cscognamiglio

I have a similar issue with my date format in Argentina (dd/mm/yyyy). Opening the sample yields this (notice DD/MM...) which is OK in my PC: Screenshot from 2019-10-25 11-28-36 Now, clicking the calendar icon and selecting today's date (it's Oct 25} yields 10/25/2019 in the USA format.

Checking the toLocaleString() page is terrifying, the options and variants is endless.
No need to choose cultures with different calendars. UK and Japan prefer yyyy-mm-dd, the ISO 8601 format that many prefer because it's not ambiguous.
I care because I'm developing an application that's supposed to be used anywhere.

juanlanus avatar Oct 25 '19 14:10 juanlanus

Any update on this? I can't use the datepicker with a DD/MM/YYYY format, no matter what I try. Even the example with the es locale on your website does not work

cscognamiglio avatar Dec 16 '19 21:12 cscognamiglio

No updates, sorry - I am pretty much going away from grommet.

Will try to keep the library updated but you can also submit a PR with a fix.

atanasster avatar Dec 16 '19 21:12 atanasster

Same here. Anyone who wants to usse grommet, my tip is to go away. Has so many things missing

leonardobork avatar Apr 01 '20 17:04 leonardobork