Enable users to enter date in specific format without changing the user's locale (pyUseLocaleForDateFormat)

I would like to allow all the users of my app to enter date in European format (DD/MM/YYYY) in a date field. If I set the user’s locale to en_GB, it’s working fine but there are users outside Europe as well and I don’t want to set a common locale for all users but the date format should be the same for all of them.

I came across the property ‘pyUseLocaleForDateFormat’ on the Operator page which is blank by default. I tried setting this property value to ‘en_GB’ and the user’s locale as ‘en’ but it’s allowing the user to enter date in US format only (MM/DD/YYYY). Is anyone aware of what this property is used for? Can we use this to set the specific locale just for dates and can the user’s locale be different from this?

@BrijeshV

We have formatDateTime function where you can update the display format for the date as per requirement. Try using that.

@PrakashDeep Displaying date in a specific format can be done but the issue here is with the format in which Pega allows the user to enter the date

@BrijeshV Any info on this. I also need to set the format specfici to US while entering/selecting date from calendar

@BrijeshV @BalaM560 On the Date Time Control you can choose the format based on three options: User Time Zone Standard TimeZone and Property. The selected option overrides the Browser or Operator level Local setting. You can choose Standard Timezone and define the format to ensure that all users can enter the date in the desired format consistently regardless of their individual locale settings.

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided references.

How to allow user to input date in the format MMDDYYYY

Date format changes to US by default while entering the data manually

Need to override localization format for user entry date time control

Date format input via a calendar changes when logged in from a different machine.

Change date format from MM/DD/YYYY to DD/MM/YYYY in constellation views when date field is configured for user input

Date and time inputs - Constellation

Selecting the date and time format