Closed mikib0 closed 1 year ago
@iM-GeeKy supported translations and maybe this part of the docs may need to be updated right?
@iM-GeeKy supported translations and maybe this part of the docs may need to be updated right?
Yeah, that seems like an appropriate spot for it.
The date format length in some locales like ko and ar may not equal the date input text length. For example a date input like 02/01/2023 has equal length with the date format MM/DD/YYYY in the en locale, but it doesn't with the ar date format يوم/شهر/سنة (length = 11). This raises a problem with this condition check text.length == mask.length
in TextInputWithMask
component, as the mask length (11 in the case of ar) doesn't equal the date input text length (8). What should we do now? @iM-GeeKy
The date format length in some locales like ko and ar may not equal the date input text length. For example a date input like 02/01/2023 has equal length with the date format MM/DD/YYYY in the en locale, but it doesn't with the ar date format يوم/شهر/سنة (length = 11). This raises a problem with this condition check
text.length == mask.length
inTextInputWithMask
component, as the mask length (11 in the case of ar) doesn't equal the date input text length (8). What should we do now? @iM-GeeKy
Ahh, I think I see what you're talking about. The only thing I can think of off the top of my head is potentially having some sort of getter function to retrieve the right mask length via a switch/case or something of the like. It's not the most elegant solution though, perhaps @RichardLindhout has an idea?
Looks good to me! Maybe we should indeed do some kind of function or put some things outside of the component so we can get the maskLength everywhere. I'm not sure or have the time too check this out deep but update is welcome, and then we can merge!
Hi @mikib0, will you continue with this PR or maybe can I help in something to continue it?
Thanks!
I'm going to close due to lack of movement. If it is still applicable, please update and we can readdress it.
Closes #232
Before:
After: