日期格式化 Mobile Flex 项目
我有一个可以获取 rss feed 的移动应用程序。 rss feed 上的日期显示周五,2011 年 10 月 28 日 17:30:00 GMT,我希望将其呈现为 cst 时间标准 dd/mm/yyyy 和时间中的短日期。我的应用程序的代码如下。任何帮助都会很棒 这是第一次使用 Adobe Flash Builder。
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:ns1="*"
backgroundColor="#74171E" title="Mediacom 2 / Paulbunyan 32"
viewActivate="refresh()">
<fx:Script>
<![CDATA[
protected function getData():void
{
getDataResult.token = iCTVChannel232.getData();
}
public function refresh(): void {
getData();
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getDataResult"/>
<ns1:ICTVChannel232 id="iCTVChannel232"/>
</fx:Declarations>
<s:DataGrid id="dataGrid" left="10" right="10" top="10" bottom="10">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="pubDate" width="65" headerText="Date"></s:GridColumn>
<s:GridColumn dataField="title" headerText="Title"></s:GridColumn>
</s:ArrayList>
</s:columns>
<s:AsyncListView list="{getDataResult.lastResult}"/>
</s:DataGrid>
<s:actionContent>
<s:Button icon="@Embed('/assets/refreshico.png')"
click="Object(navigator.activeView).refresh()"/>
</s:actionContent>
</s:View>
I have a mobile app that gets a rss feed. The date on the rss feed displays Fri, 28 Oct 2011 17:30:00 GMT and I would like that to render as a short date in cst time standard dd/mm/yyyy and time. The code for my app is below. any help would be great This is the first time working with Adobe Flash Builder.
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:ns1="*"
backgroundColor="#74171E" title="Mediacom 2 / Paulbunyan 32"
viewActivate="refresh()">
<fx:Script>
<![CDATA[
protected function getData():void
{
getDataResult.token = iCTVChannel232.getData();
}
public function refresh(): void {
getData();
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getDataResult"/>
<ns1:ICTVChannel232 id="iCTVChannel232"/>
</fx:Declarations>
<s:DataGrid id="dataGrid" left="10" right="10" top="10" bottom="10">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="pubDate" width="65" headerText="Date"></s:GridColumn>
<s:GridColumn dataField="title" headerText="Title"></s:GridColumn>
</s:ArrayList>
</s:columns>
<s:AsyncListView list="{getDataResult.lastResult}"/>
</s:DataGrid>
<s:actionContent>
<s:Button icon="@Embed('/assets/refreshico.png')"
click="Object(navigator.activeView).refresh()"/>
</s:actionContent>
</s:View>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了得到日期,我想我会做这样的事情(诚然,这可能不是最好的方法!):
我认为这会起作用。你必须在我设置快捷方式的地方进行更改,但我认为你可以弄清楚。
另外,我不确定我实际上是否放置了正确的字符串位置,因此您可能需要更改它们。
to get the date I think I would do something like this (admittedly it might not be the best way!):
I think this would work. You'd have to make changes where I made shortcuts, but I think you can figure it out.
Also, I'm not certain I actually put the correct position in for the strings, so you might have to change those.