Good day, I have a small problem with the dates when sending them to the controller (POST) of the view. This is my form:
<form class="form-horizontal" method="post" action="/home/insert" novalidate>
<div class="col-sm-3 input-group" style="float: left;">
<input type="text" class="date start form-control" placeholder="yyyy/mm/dd" required style="border-right: 0;"value="@string.Format("{0:MM-dd-yyyy}", Model.evento[0].Fecha_Inicio)" />
<span class="input-group-addon fui-calendar" style="background: transparent; color: #bdc3c7;"></span>
</div>
<div class="col-sm-2 input-group" style="float: left; width: 20.9%;">
<input type="text" class="time start form-control" placeholder="Hora Inicio" required style="border-right: 0;" value="@string.Format("{0:HH:mm:ss}", Model.evento[0].Fecha_Inicio)" />
<span class="input-group-addon fui-time" style="background: transparent; color: #bdc3c7;"></span>
</div>
</form>
This is my model:
public class insertEvento
{
public string Fecha_Inicio { get; set; }
public string Hora_Inicio { get; set; }
}
That way it works fine but what I really want is to send the date to my model in this way
public class insertEvento
{
public DateTime Fecha_Inicio { get; set; }
}
But without having to modify my fields of the form since I am using third-party libraries that in the date field only gives me the date and in the time field only the time in 24 hours format