开发者

Display value in Date field irrespective of date format

开发者 https://www.devze.com 2023-04-06 04:11 出处:网络
I have an mx:DateField in my Flex UI that has a formatString=\"dd.mm.yyyy\" attached to it. However, the initial value for that field ma开发者_StackOverflow中文版y not be in the format specified/defin

I have an mx:DateField in my Flex UI that has a formatString="dd.mm.yyyy" attached to it. However, the initial value for that field ma开发者_StackOverflow中文版y not be in the format specified/defined for the DateField (due to legacy reasons). So, currently, if I just set that value (text) on the DateField, the field is shown empty. I think because it fails to accept the value in a format different than what's configured.

I need to (somehow) be able to display the incoming value in the date field. Is that possible? If yes, how?

P.S. : The incoming value's format will not be known, so I cannot transform it to my desired format :(.


Parse the value into a date first, then use the dateField's dateToString method to set the text.

0

精彩评论

暂无评论...
验证码 换一张
取 消