Thomas_Repking | 2024-06-11 15:37:49 UTC | #1
I want to allow input of birthdates in a script. Because using the calendar in the date input script component requires too many clicks, I want to use the input script component and validate it so that an input of DDMMYYYY is automatically formatted with dots as DD.MM.YYYY. I tried it with the following regex:
def formatdate(inputdate):
formatteddate = re.sub(r'^(\d{2})(\d{2})(\d{4})$', r'\1.\2.\3', inputdate) return formatted_date
However, when I test it in preview mode, the input field is highlighted in red, and the format is not converted. Can someone tell me how I need to formulate the regex?
system | 2024-07-12 15:38:10 UTC | #2
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 26711