import {ICellEditorAngularComp} from 'ag-grid-angular'; import {AfterViewInit, Component, ViewChild} from '@angular/core'; import {ICellEditorParams} from 'ag-grid-community'; import {IonDatetime} from '@ionic/angular'; @Component({ selector: 'cell-editor-select', template: ``, }) export class DatetimeEditorComponent implements ICellEditorAngularComp, AfterViewInit { public params: ICellEditorParams; public value: string; public format = 'YYYY-MM-DD h:mm a'; @ViewChild('picker') picker: IonDatetime; agInit(params: ICellEditorParams): void { this.params = params; this.value = this.params.value; // @ts-ignore if ( this.params.colDef.additionalData.format ) { // @ts-ignore this.format = this.params.colDef.additionalData.format; } } getValue(): any { return this.value; } ngAfterViewInit(): void { this.picker.open(); } finishEdit($event) { this.params.stopEditing(); } }