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

System Design

1. Scalability Scalability refers to a system’s ability to handle increasing workloads, users, or data without affecting performance.. A sca...