Monday, May 06, 2019

Render Date field in specific Date Format into ag-Grid Angular 6

In you ag-Grid if you want to display date field in specific format do the following steps

  1. npm Install moment --save
  2. in your .ts file use below

 import * as moment from 'moment';

columnDefs =
[{
headerName: 'Effective Start Date', field: 'EffectiveStartDate',
cellRenderer: (data) => {
return  data.value ? (moment(data.value).format('MM/DD/YYYY')) : '';}
}];


For more info on moment please use https://momentjs.com/


No comments: