Hi I have two DateTimeEditorFor editors for an Meeting StartTime and a EndTime (see Screenshot). Now if I inser 12:30 as Start Time and 15:15 as End Time, in the debugger both fields have the same value (see Screenshot). Is this a Bug? Or have I made any mistakes?
Hello Stanislas,
Thank you for using our community.
I have investigated your case and manages to pass the editors values when submitting and the values are accurate. Here is how I accomplished that:
@(Html.Infragistics()
.DateTimeEditorFor(m => m.StartDate)
.ID("dateInfo")
.Width(100)
.DateDisplayFormat("time")
.NullText("Enter Date")
.DateInputFormat("hh:mm:ss")
.Render()
)
.DateTimeEditorFor(m => m.EndDate)
.ID("dateTermino")
<input id="btn" type="button" title="Submit" value="Submit"/>
$("#btn").click(function submitHandler() {
var startValue = $("#dateTermino").igEditor("option", "value");
var startTime = startValue.getHours() + ":" + startValue.getMinutes() + ":" + startValue.getSeconds();
var endValue = $("#dateInfo").igEditor("option", "value");
var endTime = endValue.getHours() + ":" + endValue.getMinutes() + ":" + endValue.getSeconds();
$.ajax({
type: "POST",
data: { newEndTime: endTime, newStartTime: startTime },
url:"@Url.Action("SaveTime")",
success:function successHandler() {
aler("time");
}
})
});
public ActionResult SaveTime(DateTime? newEndTime, DateTime? newStartTime)
{ …
Please take a look at the code I provided you and let me know how it works for you.