ExtJS不能解析'2010-01-14T04:37:11Z'?Hack ExtJS 的parseDate

最近在研究Grails+ExtJS做应用。Grails render到前台的Date格式默认是ExtJS的'Y-m-dTH:m:sZ'格式, 但ExtJS却不认'2010-01-14T04:37:11Z'。Google了一下,找到一篇文章

引自“http://www.timeanddate.com/library/abbreviations/timezones/military/z.html”:

Military time zones:

Z – Zulu Time Zone

Time zone offset: UTC

Z is in the same time zone as Coordinated Universal Time (UTC)

Time zone abbreviation: Z

Full name is Zulu Time Zone

Email time zone indicator: +0000

An email sent from someone in the Z time zone will have the time zone listed as "+0000" in the headers of the email. (However, "+0000" does not have to be in Z, as other time zones could have the same UTC offset).

Other time zones in Military...

 

原来Z代表Zulu啊。试试把'Z'换成'+0000'

 

Date.parseDate = function(input, format, strict) {input = input.replace(/Z$/, '+0000');/*...*/}

搞掂。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值