sencha touch - 日期格式
我从我的商店获取日期...
显示它时,它是这样的..
Fri Aug 12 2011 08:56:18 GMT+0530 (IST)
但我想显示像
12 Aug 2011
在我的商店中我保留的类型为日期。
Ext.regModel('allVisit', {
fields: [
{ name: 'visitDate', type: 'date'},
{ name: 'visitId', type: 'string'},
{ name: 'visitDetailId', type: 'string'},
]
});
提前致谢!
I am getting the date from my store...
while display it, its like this..
Fri Aug 12 2011 08:56:18 GMT+0530 (IST)
but i want to display like
12 Aug 2011
In my store i kept as the type as date.
Ext.regModel('allVisit', {
fields: [
{ name: 'visitDate', type: 'date'},
{ name: 'visitId', type: 'string'},
{ name: 'visitDetailId', type: 'string'},
]
});
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最简单的方法是在输出模板中指定格式,例如:
Easiest way is to specify the format in your output template e.g:
尝试在模型中使用 dateFormat (dateFormat: 'g:i a') :
您可以从 此文档
try to use dateFormat (dateFormat: 'g:i a') in your model :
You can get help from this doc
您能提供您尝试显示日期的代码吗?
您很可能必须在那里提供您想要的格式。
Can you provide the code where you are trying to display the Date?
You'll most likely have to provide the format you want there.
您必须在主 javascript 文件的开头声明日期模式,例如
然后您可以根据您的需要应用这些模式,如下
所示:
希望它会有所帮助......
You have to declare the date patterns in the beginning of the main javascript file such as
Then you can apply these patterns according to your need as follows
Eg:
Hope it will help....