MVC Calendar

An inline calendar display HTML Helper for ASP.Net MVC

This project is maintained by cbeckner

Asp.Net MVC Calendar Html Helper

An inline calendar display HTML Helper for ASP.Net MVC

Using

Using it can be as simple as:

<%=Html.Calendar() %>

or

@Html.Calendar()

That's It!

Additional Options

I am working to make the control as extensible as possible for the various scenarios that it will hopefully be used for. As such, there are several overloads that you can take advantage of.

You can specify the month that you want the calendar to display by passing in a DateTime object.

@Html.Calendar(DateTime.Now)

Events

You can also fill the calendar with events by passing in a list of CalendarEvent objects.

@{
  var events = new List<CalendarEvent>();
  events.Add(new CalendarEvent(new DateTime(2014, 1, 15), new DateTime(2014, 1, 20), "#333333", "viewDate(12345"));     
}
@=Html.Calendar(DateTime.Now,events)

The CalendarEvent object takes the following arguments:

Additionally, the CalendarEvent class exposes two functions.

Styling

There is an additional helper that will provide some out of the box styling for the calendar. This should be called prior to calling the first calendar on your page. If you want to override one or two of the styles, I would suggest calling the css helper in the head of the site and then overriding the classes in your pages stylesheet.

To call the CSS control

@Html.CalendarCss()

The CSS exposes the following classes:

Copyright 2014 by Cody Beckner!