22. April 2014 18:38
/
victor
/
Coding
/
Comments (0)
I have been playing with ngGrid control these days. Today, I want to format a date column in the grid. After a little bit research, I found it was very easy to do. All you need is put this in the gridOption object in your controller.
$scope.gridOptions = {
data: 'mydata',
enableRowSelection: true,
multiSelect: false,
enableColumnResize: true,
columnDefs: [
{ field: 'startDate', displayName: 'Date', cellFilter: 'date:\'yyyy-MM-dd\'' }]
};
In the example, I use "yyyy-MM-dd" as format. But you can change that to whatever format you like :).
c5c4ae7b-f02c-4414-b79e-322bea5a6159|1|1.0|27604f05-86ad-47ef-9e05-950bb762570c