Guilherme Bley
Guilherme Bley

Reputation: 376

Hour in input date Blazor

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

My code:

<div class="form-group">
    <label for="Validade" class="p-3">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?

Upvotes: 1

Views: 1590

Answers (1)

Mohammad Aghazadeh
Mohammad Aghazadeh

Reputation: 2825

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"/>

Upvotes: 3

Related Questions