I want to validate if the date input to a function is a valid date. I have the following HTML markup
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-calendar"></i> Check in</span>
<input id="checkinner" type="date" onchange="datechange(this)" class="form-control" data-inputmask="'alias': 'dd/mm/yyyy'" placeholder="Enter checkin date of birth">
</div>
And the following is my function in javascript
function datechange(element) {
if (element.value.IsValidDate())
{
//code
}
}
Appreciate the love and help!