Remove auto Date Picker in chrome when using tag helpers in Asp.Net MVC core 2.2

Viewed 892

Using the following tag helper within my asp.net core 2.2 app, Chrome shows a html5 date picker (as shown).

    <div class="col-md-6 input-group-sm">
        <label asp-for="Dob"></label>
        <input asp-for="Dob" class="form-control"/>
        <span asp-validation-for="Dob" class="text-danger"></span>
    </div>

Model property for DOB is -

public DateTime? Dob { get; set; }

What is generated in chrome -

enter image description here

This does not occur within Internet Explorer and i can see that it is due to chrome adding type="datetime-local" to the html.

Question

Is there a way to remove this auto generated datepicker so that i can use an alternative?

1 Answers

You can simply use type="text" to remove default type="datetime-local".

<input type="text" asp-for="Dob" class="form-control"/>
Related