jfoley
05-11-2010, 05:50 PM
I'm using a datagrid and one of the columns have a labelFunction tied to it. The data that is passed to my labelFunction contains 'lastUpdated' which has a string in this format: Thu Feb 04 05:31:10 GMT 2010
Which, is obviously a date object. I'm trying to reformat the date to be mm/dd/yyyy.
I'm currently trying this to no avail:
private function formatDate(item:Object, column:DataGridColumn):String
{
var itemDate:Date = item.lastUpdated as Date;
return itemDate.getFullYear();
}
For some reason itemDate always equals null even though the data in the item object is there. Hence, the labelFunction bugs out. Any ideas?
Lemme know if I can provide any further info. Thanks!
Which, is obviously a date object. I'm trying to reformat the date to be mm/dd/yyyy.
I'm currently trying this to no avail:
private function formatDate(item:Object, column:DataGridColumn):String
{
var itemDate:Date = item.lastUpdated as Date;
return itemDate.getFullYear();
}
For some reason itemDate always equals null even though the data in the item object is there. Hence, the labelFunction bugs out. Any ideas?
Lemme know if I can provide any further info. Thanks!