Date format filter using ag-grid

12,688

Solution 1

Use valueFormatter

Example (using moment): headerName: '...', field: '...', valueFormatter: (data) => moment(data.value).format('L')

Solution 2

I noticed that this question was eventually asked of the ag-grid author, and answered here:

https://github.com/ceolter/ag-grid/issues/1029

The answer is: such doesn't exist. if you want to format dates, either use cellFormatter or create your own cellRenderer for displaying dates.

Share:
12,688
ⴱⵓⵖⴰⵏⵉ ⵔⴰⴼⵉⵇ
Author by

ⴱⵓⵖⴰⵏⵉ ⵔⴰⴼⵉⵇ

Updated on June 06, 2022

Comments

  • ⴱⵓⵖⴰⵏⵉ ⵔⴰⴼⵉⵇ
    ⴱⵓⵖⴰⵏⵉ ⵔⴰⴼⵉⵇ about 2 years

    Does there exist a format filter in ag-grid like this?

    field : 'replacementPieceDesignation.replacementPiece.maxDate',
    headerName  : "Date (max)",
    cellFilter: 'date:\'MM/dd/yyyy\'',`
    

    Thank you