Friday, 25 June 2021

React - Ag-grid - Column date converions with moment.js

React - Ag-grid - Column date converions with moment.js

--------------------------------------------------------


projectCMD:>npm install --save moment react-moment


react-Ag-grid-component.js

-------------------------------

import * as moment from 'moment';


const agGridColumn = [

{

headerName: 'Employee Name',

field: 'empName',

},

{

headerName: 'Date of Birth',

field: 'dob',

cellRenderer: (data) => {

return moment(data.createdAt).format('MM/DD/YYYY HH:mm')

}

},

No comments:

Post a Comment

Claude Code worflow

The Claude code task cycle 1. Gater context Reads files, explore projec structure, code base 2. Plan Break the task in to steps 3. Exe...