# AgDateInputComponent documentation

**Kind:** component

**Selector:** `si-ag-date-input`

```
import { AgDateInputComponent } from '@siemens/element-ng/ag-grid';
```

Custom AG Grid date component using Element datepicker. This component replaces the native HTML date input with the Element design system datepicker.

```
component AgDateInputComponent implements IDateComp, OnDestroy
```

#### Attributes and Methods

##### afterGuiAttached

[Source for afterGuiAttached](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L74-L90>)

Lifecycle hook called after the component GUI is attached. Sets up event listeners to prevent filter popup from closing when interacting with calendar.

Implements `BaseDate`

```
afterGuiAttached(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### agInit

[Source for agInit](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L98-L100>)

```
agInit(params: IDateParams<any, any>): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [params](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L98-L98>) | `IDateParams<any, any>` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### date

[Source for date](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L46-L46>)

**Type:** `Date | undefined`

**Default:** `undefined`

The selected date value.

##### getDate

[Source for getDate](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L102-L104>)

Returns the current date represented by this component

Implements `IDate`

```
getDate(): Date | null
```

**Returns:** [Date](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date>)`  |  `[null](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null>)

##### getGui

[Source for getGui](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L106-L108>)

Return the DOM element of your component, this is what the grid puts into the DOM

Implements `IComponent<IDateParams<any, any>>`

```
getGui(): HTMLElement
```

**Returns:** [HTMLElement](<https://developer.mozilla.org/docs/Web/API/HTMLElement>)

##### setDate

[Source for setDate](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L110-L115>)

Sets the date represented by this component

Implements `IDate`

```
setDate(date: Date | null): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [date](<https://github.com/siemens/element/blob/main/projects/element-ng/ag-grid/components/ag-date-input.component.ts#L110-L110>) | `Date \| null` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)
