0
I have the date fields:
@Html.EditorFor(model => model.DataInicio, new { htmlAttributes = new { @class = "form-control input-sm", @placeholder = "DD/MM/AAAA hh:mm" } })
@Html.EditorFor(model => model.DataFim, new { htmlAttributes = new { @class = "form-control input-sm", @placeholder = "DD/MM/AAAA hh:mm" } })
And the Javascript:
$(function () {
$('#DataInicio').datetimepicker();
$('#DataFim').datetimepicker({
useCurrent: true //Important! See issue #1075
});
$("#DataInicio").on("dp.change", function (e) {
$('#DataFim').data("DateTimePicker").minDate(e.date);
});
$("#DataFim").on("dp.change", function (e) {
$('#DataInicio').data("DateTimePicker").maxDate(e.date);
});
});
And it was setting normally for the current time but now it starts with the values:
01/01/0001 00:00
Arrows...
Some mistake in the Javascript or in the HTML?
It worked partially, is now allowing to set an earlier date to today’s date, which before was not possible...
– João Ignácio