@{
    var today = DateTime.Now.Date;
    var minDate = new DateTime(today.Year, 1, 1);
    var maxDate = new DateTime(today.Year, 12, 31);
}

@section Scripts{
<script>
    function itemValidator(date) {
        var weekday = date.getDay();
        return weekday != 0 && weekday != 6;
    }
</script>
}

<div>
    <P>Use this <b>InputDate</b> control to select a date. 
    Notice you won't be able to select or type weekends.</P>
    <c1-input-date value="@today" min="@minDate" max="@maxDate" item-validator="itemValidator">
    </c1-input-date>
</div>

@section Description{
    This sample shows how to set <b>item-validator</b> attribute to a function to determine whether dates
    are valid for selection and typing.
}