I've following grid with inline edit. For selecting date and time they have their respective date and time controls. I want to post date in '12-Sep-2015 12.00.00' format and time in '09:00:00' format to mvc control action. But when I post the data, date is in the 'Wed Sep 23 2015 00:00:00 GMT-0400 (Eastern Daylight Time)' format. Time is in the 'Sat Sep 19 2015 15:00:00 GMT-0400 (Eastern Daylight Time)' format. This only happens if I change date and time value. If I don't change, values are posted the way I want to. What do I do to post data in proper format after edit?
@(Html.Kendo().Grid<Kyklos.ClinicPortal.ViewModels.AppointmentViewModel>()
.Name("UpCmgApptGrid").
Columns(columns =>
{
columns.Bound(c => c.strAppintmentDate).Title("Appintment Date").Format("{0:MM/dd/yyyy}").EditorTemplateName("Date");
columns.Bound(c => c.strAppintmentTime).Title("Appintment Time").Format("{0:hh:mm tt}").EditorTemplateName("Time");
columns.Bound(c => c.DoctorName).Title("Doctor");
columns.Command(command => { command.Edit(); }).Title("Edit").Width(250);
columns.Command(command => { command.Destroy(); }).Title("Delete").Width(150);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.Events(events => events.Cancel("onCancel"))
.DataSource(
dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(a => a.PatAppointment.AppointmentId);
model.Field(a => a.DoctorName).Editable(false);
})
.Read("UpcomingAppointment_Read", "Appointment", new { PatientId = Model.PatAppointment.PatientId })
.Update(update => update.Action("UpcomingAppointment_Update", "Appointment"))
.Destroy(update => update.Action("UpcomingAppointment_Destroy", "Appointment"))
)
)