cancel
Showing results for 
Search instead for 
Did you mean: 

Date format based on locale

former_member531036
Participant

Hi Gurus,

I am currently making changes to some of our existing forms so that the dates and quantities will format properly based on the locale. I am passing in the local to the form and using this to set the format. Everything works fine except for the US dates, which is getting formatted as Jan 21, 2015 instead of 01/21/2015. Because of space constraints I need to use the "shortened" version. I currently have the field set as type Date/Time and nothing listed under Patterns. I tried using date.short{} in the pattern field, but ended up with 01/21/15. Date.medium{} and date.default{} gave me the Jan 21, 2015. Does anyone know if there is a way to get the full 4 digit year?

Thanks!

Julie

Accepted Solutions (0)

Answers (1)

Answers (1)

SandySingh
Active Contributor
0 Kudos

Hello Julie

You can create the following pattern

date(en_US) {MM/DD/YYYY}



A default date value must conform to the short format for the locale specified for the date field. However, by default, Designer displays the default value in the medium locale format at both design time and run time.

For example, consider a form with a Date/Time Field set to use the German (Germany) locale. You enter the default value for a date in the short format DD.MM.YY. After you change the focus to another field, the value specified in the field on the page is displayed in the medium format DD.MM.YYYY. The formatted value also appears in the medium format if you view the form in the Preview PDF tab.

Note: At run time, by default, form fillers must edit the value of date/time fields using the short format for the locale specified for the field. If you specify an Edit Pattern on the Edit tab in the Patterns dialog box (Field tab > Patterns), that pattern overrides the short format, and users must enter data that conforms to the Edit Pattern.

Adobe LiveCycle ES3 * Formatting field values and using patterns

regards

sandy

former_member531036
Participant
0 Kudos

Hi Sandy,

Thank you for your response. Sorry it took so long to reply. If I'm understanding what you're saying, I should enter in 'date(en_US){MM/DD/YYYY}' in the Display tab of the Patterns button. Is that correct? If so, that works for the en_US locale, however, if the locale passed into the form is de_DE for example, the date fields still display in the US format. I am trying to dynamically set the locale by passing in a parameter to the form and using that value in the Form Ready event. It appears that when a display pattern is set up under the Patterns button, that takes precedence.

Is what I'm trying to do possible?

Thanks!

Julie

SandySingh
Active Contributor
0 Kudos

Hello Julie,

If you want to support different date format based on dynamic locales, then by default "medium locale format" will be displayed for US - MM/DD/YY. This is as per with Adobe documentation


Adobe LiveCycle ES3 * Formatting field values and using patterns

However, by default, Designer displays the default value in the medium locale format at both design time and run time.

Regards

Sandy

former_member531036
Participant
0 Kudos

I was afraid you were going to say that. Thanks anyway!

Julie