Skip to main content
luizb1735
Known Participant
Jul 29, 2024 8:59 PM UTC
Question

DateField Mask

I need some help with datefield masks, i'm trying to input the date 15062000 and i need that the text be corrected to 15/06/2000.
How can I do that?

Keep using dateField

6 replies

Inspiring
Jul 30, 2024 12:56 AM UTC

There is no auto correct option as of now, can you please elaborate your requirement?

Brainy
Jul 30, 2024 5:05 AM UTC

AFAIK, this is not possible using datefield as of now.

stefanhelzle0001
Brainy
Jul 30, 2024 6:22 AM UTC

You could do that using a text field. Then parse the entered values into a date inside the saveInto.

stewart.burchell
Employee
Jul 30, 2024 7:48 AM UTC

So as [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05] says you could use a text field, apply the necessary validations, and then construct the date by extracting the day/month/year components and concatenating them into the relevant format before saving into the target variable.

But I have to ask why you feel it necessary to go to all that trouble. The data field provides all of the necessary validation, it'll adjust accordingly to different locales (e.g. mm/dd/yyyy for the US, dd/mm/yyyy for the UK), has a date picker, all of which costs the user two extra key strokes to include the "/" separator.

Brainy
Jul 30, 2024 8:19 AM UTC

Yes, we should use the Date field.

Also, it would be good if Appian provided this masking capability in future releases (automatically formatting date). This will increase data entry speed.

prasantap0900
Participating Frequently
Aug 7, 2024 9:51 AM UTC

a!localVariables(
  local!a:02022024,
 {
   a!textField(
  label: "Date",
  value: text(local!a, "dd/mm/yyyy")
)
}
)

You can try like that but not a good practice.