I'm setting the value of a property using the following JavaScript code
var
documentList = $(
"#documentsList"
).data(
"kendoListView"
);
var
dataSource = documentList.dataSource;
var
dataUid = documentList.select().attr(
"data-uid"
);
var
item = dataSource.getByUid(dataUid);
var
datepicker = $(
"#documentDate"
).data(
"kendoDatePicker"
);
item.set(
"DocumentDate"
, datepicker.value());
if
(dataSource.hasChanges()) {
dataSource.sync();
}
My controller is receiving the post when the datasource is synced and the other properties are being set. This is the C# of my controller
public
JsonResult Update([DataSourceRequest]DataSourceRequest request, InboxDocument document)
{
return
Json(
new
[] {SharePointHelper.UpdateInboxDocument(HttpContext, document)}.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
}
All the other properties that are set are being sent through, but when I look at the request sent through in F12 tools, the following is displayed.
{DocumentDate: {errors: ["The value '6/21/2016 1:00:00 AM' is not valid for DocumentDate."]},…}
This is the same for any other date values.