Thursday, 28 March 2013

Format Date issue in Sencha Touch 2

In order to display the date in sencha touch 2, I tried the below code
issueName = new Date("2013-02-14");
issueName = Ext.Date.format(issueName,"F d, Y");
It works fine in Google Chrome, But i got 'undefined' error in safari. So i tried the below code
var pubDate = "2013-02-14";
issueName = pubDate.replace(/-/g,'/');
issueName = Ext.util.Format.date(issueName,"F d, Y");

This works fine for both Chrome and Safari Browser. I hope this Post this will be helpful for those who may came across this same issue. Hope, you enjoyed this Post.

No comments:

Post a Comment