Hi,
That is almost working. In my grid I have 4 columns of type date. The javascript function shows in console.log(cols); that all 4 date columns are type "date".
In the for loop the 1st date columns is corrected the next 3 columns looses their type. The porperty cols[i].type returns Null.
<ejs-grid id="Grid" locale="nl" rowSelected="rowSelected" allowFiltering="true" allowSorting="true" allowPaging="true" load="onLoad">
<e-grid-editsettings allowAdding="true" allowDeleting="true" allowEditing="true" showDeleteConfirmDialog="true"></e-grid-editsettings>
....
<e-grid-columns>
....
<e-grid-column field="StartDate" headerText="Start" editType="datetimepickeredit" textAlign="Right" width="140px"></e-grid-column>
<e-grid-column field="DepartDate" headerText="Depart" editType="datetimepickeredit" textAlign="Right" width="140px"></e-grid-column>
<e-grid-column field="ArrivalDate" headerText="Arrival" editType="datetimepickeredit" textAlign="Right" width="140px"></e-grid-column>
<e-grid-column field="EndDate" headerText="End" editType="datetimepickeredit" textAlign="Right" width="140px"></e-grid-column>
</e-grid-columns>
</ejs-grid>
function actionBegin(args)
{
if (args.requestType === "save") {
args.data['ShipId'] = ddlShips.filter(function (d) { return d.ShipName === args.data['ShipName'] })[0].ShipId;
var grid = document.getElementById("Grid").ej2_instances[0];
var cols = grid.columns;
console.log(cols);
for (var i = 0; i < cols.length; i++) {
console.log(cols[i].type);
if (cols[i].type == "date" || cols[i].type == "datetime") {
var date = args.data[cols[i].field];
//args.data[cols[i].field] = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(),date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
console.log(args.data[cols[i].field]);
}
}
}
}
Regards,
Marco