Home > Software design >  Hour in input date Blazor
Hour in input date Blazor

Time:07-15

I'm tried to set a hour in input date in blazor, but i don't know if it is possible.

My code:

<div >
    <label for="Validade" >Validade</label>
    <InputDate @bind-Value:format="dd/MM/yyyy hh:mm:ss" @bind-Value="@InfracaoDto.Validade" />
    <ValidationMessage For="@(()=>InfracaoDto.Validade)" />
</div>

Result:

enter image description here

Is there any way of the input get hour, minute and second?

CodePudding user response:

change

  <InputDate @bind-Value:format="dd/MM/yyyy hh:mm:ss" @bind-Value="@InfracaoDto.Validade" />

to

<InputDate Type="InputDateType.DateTimeLocal" @bind-Value:format="dd/MM/yyyy hh:mm:ss" @bind-Value="@InfracaoDto.Validade"/>
  • Related