Flex 4.5, setting locale for datefield does not work

六眼飞鱼酱① 提交于 2019-12-08 11:08:54

问题


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...



来源:https://stackoverflow.com/questions/6823473/flex-4-5-setting-locale-for-datefield-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!