Answer the question
In order to leave comments, you need to log in
ASP.Net core how to make calendar display only with month and year?
The model is created, let's say:
public class Person
{
public int PersonId { get; set; }
public string Name { get; set; }
[DataType(DataType.Date)]
public DateTime Birthday { get; set; }
}
<div class="form-group">
<label class="control-label" for="Birthday">День рождения</label>
<input class="form-control" type="date" data-val="true" data-val-required="Введите день рождения" id="Birthday" name="Birthday" value="">
<span class="text-danger field-validation-valid" data-valmsg-for="Birthday" data-valmsg-replace="true"></span>
</div>
Answer the question
In order to leave comments, you need to log in
somewhere in the view code or javascript you need to add / correct something like this
or
$('.datepicker').datepicker({
format: 'mm/yyyy'
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question