Reputation: 4202
I have the following situation, I am display some files from Amazon S3 in an ExtJs grid. The information displayed includes, the Name, the Size, and Last Modified date time. Now the 'LastModified' displays the time in GMT in ISO 8601 format. I am wondering if there is any way for ExtJS to change that time when displaying to the time zone that the given computer is in?
Upvotes: 1
Views: 6028
Reputation: 15673
In a grid you can use the datecolumn xtype to render the date as you need it. here is an example:
text:'Created Date',
dataIndex:'dateCreated',
xtype:'datecolumn',
format:'Y-m-d',
width:80
Date format syntax is spelled out here . For the Timezone attribute 'T' the docs say:
T Timezone abbreviation of the machine running the code
I interpret this as saying the Timezone will be automatically set using the user's locale.
Upvotes: 2
Reputation: 311945
Use the Ext.Date.format
function to customize the format of a string representation of a JavaScript Date
.
For example, the 'c'
format seems to do what you're looking for:
Ext.Date.format(new Date(), 'c');
Returns:
2012-11-30T10:21:16-06:00
Upvotes: 3