Does anyone know how to properly format a DateTime in the grid? (Is this datatype even supported?).
No matter what I put in the \"filter\" property of the column, my
Working with a string in EF Core's format, ie. YYYY-MM-DDTHH:MM:SS, I was able to use this in the service to splice date formatting into the call (in this case read) which prepares the API data for grid consumption. The place where the work happens is in extractData which I pulled from this topic Angular 2 Date deserialization and retrofitted for my purposes. Hopefully it'll save someone the grief.
I should add, this is in the context of a service that's structured as an extended BehaviorSubject. This goes with Telerik's reactive form editing model:
private fetch(action: string = "", data?: ISomething[], guid?: string): Observable {
let options = new RequestOptions();
options.body = this.serializeModels(data);
return this.http
.get('api/controllername/controllerget', options)
.map(response => response.json()).catch(this.handleError);
}
public read() {
this.reset();
if (this.data.length) {
return super.next(this.data);
}
this.fetch()
.do(data => this.data = data)
.subscribe(data => {
this.extractData(data)
super.next(data);
});
}
private extractData(data?: any) {
data.forEach((d) => {
d.datefieldname = new Date(d.datefieldname);
});
return data;
}