Skip to main content
New Participant
Jun 27, 2023 10:58 AM UTC
Question

Date validation

Hi,

I am working on a date validation, where I want the date format based on various user locale to be converted into a common date format "dd/MM/yyyy". I am using "datetext()" function and it gets converted into the desired format whenever I tried to enter the value based on the user's calender format. But whenever I tried for other test scenarios, it fails. For example: If I enter date as "dd.MM.yyyy" in the expression of the test inputs, then in the value of the test input, I don't get the entered date in the desired format("dd/MM/yyyy") . I need every date formats of the various user locales to be converted into "dd/MM/yyyy". Please provide some suggestions.

Thank you.

    2 replies

    mathieud0001
    Genius
    Jun 27, 2023 11:01 AM UTC

    The DateField component doesn't support different formats for date entry. You would need a text field to do this which I don't recommend.

    stefanhelzle0001
    Brainy
    Jun 27, 2023 12:47 PM UTC

    There is no magic that can reliably convert ANY format into a date. Why not use a date picker?