Flex 4.5, setting locale for datefield does not wo

2019-06-13 19:25发布

问题:

For some reason, setting the application locale to nl_NL does not affect my datefield components.

Dates are still displayed in english language/formatting.

I tried using the following:

But this does not work. Am I doing something wrong?

I guess I could make a custom datefield component, where I supply the dutch translations for those dates, including the formatting, but this is a way I rather not like to go...

回答1:

you can use formatString to specify the dateFomat you wish to use.

<mx:DateField id="dateFieldEnd" formatString="YYYY/MM/DD" .. />


回答2:

I would use the following:

<mx DateField id        = "dateField" 
              dayNames  ="["S", "M", "D", "M", "T", "F", "S"]"
              monthNames="["januari", "February", "March", "April", "May",
                           "June", "July", "August", "September", "October", 
                           "November", "December"]" />

Along with the formatString option you should get what you are looking for. I know those are all English except January, but I don't know the Dutch month names...