0

I am new to MVC and C#.NET and trying to create a booking system. Below is the drop down calendar for selecting the date.

My Model:

    [Display(Name = "Date")]
    [DataType(DataType.Date)]
    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{dd/MM/yyyy}")]
    public DateTime Date { get; set; }

My View:

<div class="form-group">
        @Html.LabelFor(m => m.Date, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Date)
            @Html.ValidationMessageFor(model => model.Date)
        </div>
    </div>

Is there a way I can disable weekend dates?

1
  • 1
    maybe this helps you. look at eliminate days paragraph Aug 12, 2015 at 13:04

1 Answer 1

-1

Are you using jquery datepicker?

$('#datepicker').datepicker({beforeShowDay: $.datepicker.noWeekends }); 
2
  • No just the calendar from mvc
    – coto2
    Aug 12, 2015 at 13:58
  • The datepicker in MVC is JQuery!
    – Dez79
    Aug 28, 2015 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.