---
product: "AG Grid"
title: "Date Cell Editors"
description: "Two date cell editors are provided - agDateCellEditor for cell values provided as , and agDateStringCellEditor for date values provided as ."
framework: vue
version: "36.2.0"
related:
    - title: "Text Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-text/"
    - title: "Large Text Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-large-text/"
    - title: "Number Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-number/"
    - title: "Checkbox Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-checkbox/"
    - title: "Select Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-select/"
    - title: "Rich Select Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/vue-data-grid/provided-cell-editors-rich-select/"
llms: "https://www.ag-grid.com/archive/36.2.0/llms.txt"
---

# Date Cell Editors

Two date cell editors are provided - `agDateCellEditor` for cell values provided as [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and `agDateStringCellEditor` for date values provided as [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String).

## Enabling Date Cell Editor

Edit any of the cells in the grid below to see the Date Cell Editor.

#### Date Editor

```ts
import {
  createApp,
  defineComponent,
  onBeforeMount,
  ref,
  shallowRef,
} from "vue";
import { AgGridVue } from "ag-grid-vue3";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  DateEditorModule,
  GridApi,
  GridOptions,
  GridReadyEvent,
  ModuleRegistry,
  ValueFormatterParams,
  enableDevValidations,
} from "ag-grid-community";

if (process.env.NODE_ENV !== "production") {
  // Enable extended validations only for development
  enableDevValidations();
}

ModuleRegistry.registerModules([ClientSideRowModelModule, DateEditorModule]);

const data = Array.from(Array(20).keys()).map((val: any, index: number) => ({
  date: new Date(2023, 5, index + 1),
}));

const VueExample = defineComponent({
  template: `
        <div style="height: 100%">
                <ag-grid-vue
      style="width: 100%; height: 100%;"
      @grid-ready="onGridReady"
      :columnDefs="columnDefs"
      :defaultColDef="defaultColDef"
      :rowData="rowData"></ag-grid-vue>
        </div>
    `,
  components: {
    "ag-grid-vue": AgGridVue,
  },
  setup(props) {
    const gridApi = shallowRef<GridApi | null>(null);
    const columnDefs = ref<ColDef[]>([
      {
        headerName: "Date Editor",
        field: "date",
        valueFormatter: (params: ValueFormatterParams<any, Date>) => {
          if (!params.value) {
            return "";
          }
          const month = params.value.getMonth() + 1;
          const day = params.value.getDate();
          return `${params.value.getFullYear()}-${month < 10 ? "0" + month : month}-${day < 10 ? "0" + day : day}`;
        },
        cellEditor: "agDateCellEditor",
      },
    ]);
    const defaultColDef = ref<ColDef>({
      width: 200,
      editable: true,
    });
    const rowData = ref<any[] | null>(data);

    const onGridReady = (params: GridReadyEvent) => {
      gridApi.value = params.api;
    };

    return {
      gridApi,
      columnDefs,
      defaultColDef,
      rowData,
      onGridReady,
    };
  },
});

const app = createApp(VueExample);
app.mount("#app");
```

[Live example: Date Editor](https://www.ag-grid.com/archive/36.2.0/examples/provided-cell-editors-date/date-editor/vue3/)

The Date Cell Editor is a simple date editor that uses the standard HTML date input and requires cell values to be of type [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date).

Enabled with `agDateCellEditor` and configured with `IDateCellEditorParams`.

```js
columnDefs: [
    {
        cellEditor: 'agDateCellEditor',
        cellEditorParams: {
            min: '2000-01-01',
            max: '2019-12-31',
        }
        // ...other props
    }
]
```

### API Reference

Properties available on the `IDateCellEditorParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `min` | `string \| Date` |  |  |  |
| `max` | `string \| Date` |  |  |  |
| `step` | `number` |  |  |  |
| `includeTime` | `boolean` |  |  |  |

## Enabling Date as String Cell Editor

Edit any of the cells in the grid below to see the Date as String Cell Editor.

#### Date as String Editor

```ts
import {
  createApp,
  defineComponent,
  onBeforeMount,
  ref,
  shallowRef,
} from "vue";
import { AgGridVue } from "ag-grid-vue3";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  DateEditorModule,
  GridApi,
  GridOptions,
  GridReadyEvent,
  ModuleRegistry,
  enableDevValidations,
} from "ag-grid-community";

if (process.env.NODE_ENV !== "production") {
  // Enable extended validations only for development
  enableDevValidations();
}

ModuleRegistry.registerModules([ClientSideRowModelModule, DateEditorModule]);

const data = Array.from(Array(20).keys()).map((val: any, index: number) => ({
  dateString: `2023-06-${index < 9 ? "0" + (index + 1) : index + 1}`,
}));

const VueExample = defineComponent({
  template: `
        <div style="height: 100%">
                <ag-grid-vue
      style="width: 100%; height: 100%;"
      @grid-ready="onGridReady"
      :columnDefs="columnDefs"
      :defaultColDef="defaultColDef"
      :rowData="rowData"></ag-grid-vue>
        </div>
    `,
  components: {
    "ag-grid-vue": AgGridVue,
  },
  setup(props) {
    const gridApi = shallowRef<GridApi | null>(null);
    const columnDefs = ref<ColDef[]>([
      {
        headerName: "Date as String Editor",
        field: "dateString",
        cellEditor: "agDateStringCellEditor",
      },
    ]);
    const defaultColDef = ref<ColDef>({
      width: 200,
      editable: true,
    });
    const rowData = ref<any[] | null>(data);

    const onGridReady = (params: GridReadyEvent) => {
      gridApi.value = params.api;
    };

    return {
      gridApi,
      columnDefs,
      defaultColDef,
      rowData,
      onGridReady,
    };
  },
});

const app = createApp(VueExample);
app.mount("#app");
```

[Live example: Date as String Editor](https://www.ag-grid.com/archive/36.2.0/examples/provided-cell-editors-date/date-as-string-editor/vue3/)

The Date as String Cell Editor is a simple date editor that uses the standard HTML date input. It's similar to the Date Cell Editor, but works off of cell values with type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String).

The date format is controlled via [Cell Data Types](https://www.ag-grid.com/archive/36.2.0/vue-data-grid/cell-data-types/) and the [Date as String Data Type Definition](https://www.ag-grid.com/archive/36.2.0/vue-data-grid/cell-data-types/#date-as-string). The default is `'YYYY-MM-DD'` (or `'YYYY-MM-DDTHH:mm:ss'` for `dateTimeString`).

Enabled with `agDateStringCellEditor` and configured with `IDateStringCellEditorParams`.

```js
columnDefs: [
    {
        cellEditor: 'agDateStringCellEditor',
        cellEditorParams: {
            min: '2000-01-01',
            max: '2019-12-31',
        }
        // ...other props
    }
]
```

### API Reference

Properties available on the `IDateStringCellEditorParams&lt;TData = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `min` | `string \| Date` |  |  |  |
| `max` | `string \| Date` |  |  |  |
| `step` | `number` |  |  |  |
| `includeTime` | `boolean` |  |  |  |
