# CalendarBuilder

## Properties

### WriteAction - Func

## Methods

### DisableDates(System.Collections.Generic.IEnumerable)

Specifies the disabled dates in the Calendar component.

#### Parameters

##### disableDates - `System.Collections.Generic.IEnumerable<String>`

The array of dates that must be disabled.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .DisableDates(new string[]{ "we", "th" })
            )
             
```

### DisableDates(System.DayOfWeek\[])

Specifies the disabled dates in the Calendar component as an array of DayOfWeek enums.

#### Parameters

##### days - `System.DayOfWeek[]`

The array of DayOfWeek enums.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .DisableDates(DayofWeek.Saturday, DayOfWeek.Sunday)
            )
             
```

### DisableDates(System.String)

Specifies the disabled dates in the Calendar by using a JavaScript function.

#### Parameters

##### handler - `System.String`

The JavaScript function that will set the disabled dates.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .DisableDates("disableDates")
            )
            <script>
                function disableDates(date) {
                     var disabled = [13, 14, 20, 21];
                     if (date &amp; disabled.indexOf(date.getDate()) > -1 ) {
                         return true;
                     } else return false;
                }
            </script>
             
```

### FooterId(System.String)

Sets the template that renders the Calendar footer.

#### Parameters

##### id - `System.String`

The id of the external Kendo UI template.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .FooterId("footer-template")
            )
            <script id="footer-template" type="text/x-kendo-template">
                Today - #: kendo.toString(data, "d") #
            </script>
             
```

### Footer(System.Boolean)

Enables the Calendar footer. If set to 'false', the footer will not be displayed.

#### Parameters

##### footer - `System.Boolean`

The value that configures the visibility of the footer.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Footer(false)
            )
             
```

### MonthTemplateId(System.String)

Sets the template that renders the cells in the 'month' view.

#### Parameters

##### id - `System.String`

The id of the external Kendo UI template.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplateId("cell-template")
            )
            <script id="cell-template" type="text/x-kendo-template">
              <div class="#= data.value < 10 ? 'exhibition' : 'party' #">
                  #= data.value #
              </div>
            </script>
             
```

### MonthTemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

Sets the template that renders the cells in the 'month' view.

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The Razor View that will be used for rendering the cells content in the 'month' view.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplateView(Html.Partial("MonthTemplateView"))
            )
             
```

### MonthTemplateHandler(System.String)

Sets the template that renders the cells in the 'month' view.

#### Parameters

##### templateHandler - `System.String`

The JavaScript function that will return the content of the cells in the 'month' view.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplateHandler("monthTemplate")
            )
            <script>
               function monthTemplate(data) {
                    if(data.value < 10) {
                        return 'exhibition';
                    }
                    return 'party';
                }
            </script>
             
```

### MonthTemplate(System.String)

Sets the template that renders the cells in the 'month' view.

#### Parameters

##### content - `System.String`

The value that configures the template.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplate("#= data.value #")
            )
             
```

### MonthTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)

Sets the template that renders the cells in the "month" view.

#### Parameters

##### template - TemplateBuilder\<TModel>

The value that configures the template.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
                @( Html.Kendo().Calendar()
                           .Name("Calendar")
                           .MonthTemplate(Html.Kendo().Template()
                                    .AddHtml("test")
                            )
                )
             
```

### MonthTemplate(System.Action)

Sets the template that renders the cells in the "month" view.

#### Parameters

##### monthTemplateAction - System.Action<[MonthTemplateBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/monthtemplatebuilder)>

The action that configures the template settings of the "month" view.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .MonthTemplate(month => month.Content("#= data.value #"))
            )
             
```

### Min(System.String)

Sets the minimum date that can be selected in the Calendar.

#### Parameters

##### date - `System.String`

The value that configures minimum date.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Min("01/01/2024")
            )
             
```

### Max(System.String)

Sets the maximum date that can be selected in the Calendar.

#### Parameters

##### date - `System.String`

The value that configures maximum date.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Max("12/01/2024")
            )
             
```

### Value(System.Nullable)

Sets the selected date in the Calendar.

#### Parameters

##### date - `System.Nullable<DateTime>`

The DateTime value that sets the selected date.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Value(new DateTime(2024,07,05))
            )
             
```

### Value(System.String)

Sets the selected date in the Calendar.

#### Parameters

##### date - `System.String`

The value that sets the selected date.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Value("2024/07/05")
            )
             
```

### Selection(System.Action)

Configures the selection settings of the Calendar.

#### Parameters

##### selectionAction - System.Action<[CalendarSelectionSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarselectionsettingsbuilder)>

The action that configures the selection settings.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Selection(s => s.Action("Save", "Home", new { id = "123" }).Dates(new List<DateTime>(){new DateTime(2024,1,4), new DateTime(2024,1,5)}))
            )
             
```

### AllowReverse(System.Boolean)

Enables the user to select an end date that is before the start date. This option is available only when the selectable configuration is set to range.

#### Parameters

##### value - `System.Boolean`

The value for AllowReverse

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Calendar()
                        .Name("calendar")
                        .Selectable("range")
                        .AllowReverse()
             )
             
```

### AllowReverse()

Enables the user to select an end date that is before the start date. This option is available only when the selectable configuration is set to range.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Calendar()
                        .Name("calendar")
                        .Selectable("range")
                        .AllowReverse()
             )
             
```

### ComponentType(System.String)

Specifies the component type of the widget. "classic" - Uses the standard rendering of the widget. or "modern" - Uses new rendering with a fresh and modern look and feel..

#### Parameters

##### value - `System.String`

The value for ComponentType

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .ComponentType("modern")
            )
             
```

### Culture(System.String)

Specifies the culture info used by the component. A valid kendo culture file must be added to the page in order for the example to work. \<script src="[https://cdn.jsdelivr.net/npm/@progress/kendo-ui@{version}/umd/cultures/kendo.culture.de-DE.min.js"\&gt;\&lt;/script](https://cdn.jsdelivr.net/npm/@progress/kendo-ui@%7Bversion%7D/umd/cultures/kendo.culture.de-DE.min.js%22\&gt;\&lt;/script)>

#### Parameters

##### value - `System.String`

The value for Culture

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("calendar")
                        .Culture("de-DE")
            )
             
```

### Dates(System.DateTime\[])

Specifies a list of dates, which will be passed to the month template.

#### Parameters

##### value - `System.DateTime[]`

The value for Dates

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

### Footer(System.String)

The template which renders the footer. If false, the footer will not be rendered.

#### Parameters

##### value - `System.String`

The value for Footer

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Footer(false)
            )
             
```

### Format(System.String)

Specifies the format, which is used to parse value set with value() method.

#### Parameters

##### value - `System.String`

The value for Format

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Format("dd/MM/yyyy")
                        .Value(07/06/2024)
            )
             
```

### Max(System.DateTime)

Specifies the maximum date, which the calendar can show.

#### Parameters

##### value - `System.DateTime`

The value for Max

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Max(new DateTime(2024,12,31))
            )
             
```

### Messages(System.Action)

Allows localization of the strings that are used in the widget.

#### Parameters

##### configurator - System.Action<[CalendarMessagesSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarmessagessettingsbuilder)>

The configurator for the messages setting.

#### RETURNS

Returns the current instance of [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) .

### Min(System.DateTime)

Specifies the minimum date, which the calendar can show.

#### Parameters

##### value - `System.DateTime`

The value for Min

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Min(new DateTime(2024,1,1))
            )
             
```

### Selectable(System.String)

By default user is able to select a single date. The property can also be set to multiple or range. More information about the different selection modes can be found in the Selection article.

#### Parameters

##### value - `System.String`

The value for Selectable

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Selectable("multiple")
            )
             
```

### SelectDates(System.DateTime\[])

Specifies which dates to be selected when the calendar is initialized.

#### Parameters

##### value - `System.DateTime[]`

The value for SelectDates

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Selectable("multiple")
                        .SelectDates(new DateTime[] { new DateTime(2024,7,5), new DateTime(2024,7,10) })
            )
             
```

### WeekNumber(System.Boolean)

If set to true a week of the year will be shown on the left side of the calendar.

#### Parameters

##### value - `System.Boolean`

The value for WeekNumber

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .WeekNumber(true)
            )
             
```

### WeekNumber()

If set to true a week of the year will be shown on the left side of the calendar.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .WeekNumber(true)
            )
             
```

### Start(Kendo.Mvc.UI.CalendarView)

Specifies the start view. The following settings are available for the start value: "month" - Shows the days of the month.; "year" - Shows the months of the year.; "decade" - Shows the years of the decade. or "century" - Shows the decades from the century..

#### Parameters

##### value - [CalendarView](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/calendarview)

The value for Start

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Start(CalendarView.Month)
            )
             
```

### Value(System.DateTime)

Specifies the selected date.

#### Parameters

##### value - `System.DateTime`

The value for Value

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Value("2024/07/05")
            )
             
```

### Range(System.Action)

Specifies an initial range selection. This option is available only when the selectable configuration is set to range.

#### Parameters

##### configurator - System.Action<[CalendarRangeSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarrangesettingsbuilder)>

The configurator for the range setting.

#### RETURNS

Returns the current instance of [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) .

### ShowOtherMonthDays(System.Boolean)

When this configuration is enabled, the calendar will render days from the previous and next months in the current view.

#### Parameters

##### value - `System.Boolean`

The value for ShowOtherMonthDays

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Calendar()
                        .Name("calendar")
                        .ShowOtherMonthDays(false)
             )
             
```

### Depth(Kendo.Mvc.UI.CalendarView)

Specifies the navigation depth.

#### Parameters

##### value - [CalendarView](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/calendarview)

The value for Depth

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().Calendar()
                        .Name("Calendar")
                        .Start(CalendarView.Month)
                        .Depth(CalendarView.Year)
            )
             
```

### CenturyCellsFormat(Kendo.Mvc.UI.CenturyCellsFormats)

Defines the century cell format.

#### Parameters

##### value - [CenturyCellsFormats](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/centurycellsformats)

The value for CenturyCellsFormat

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Calendar()
                        .Name("calendar")
                        .Start(CalendarView.Century)
                        .CenturyCellsFormat(CenturyCellsFormats.Short)
             )
             
```

### Events(System.Action)

Configures the client-side events.

#### Parameters

##### configurator - System.Action<[CalendarEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendareventbuilder)>

The client events action.

#### RETURNS

Returns the current [CalendarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/calendarbuilder) instance.

#### Example

```
 
            @(Html.Kendo().Calendar()
                  .Name("Calendar")
                  .Events(events => events
                      .Change("onChange")
                  )
            )
             
```

### ToComponent()

Returns the internal view component.

#### RETURNS

The  instance that represents the component.

### Expression(System.String)

Sets the name of the component.

#### Parameters

##### modelExpression - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

#### Parameters

##### modelExplorer - `Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer`

The name.

#### RETURNS

Returns the current  instance.

### Name(System.String)

Sets the name of the component.

#### Parameters

##### componentName - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean,System.Boolean)

#### Parameters

##### deferred - `System.Boolean`

#### RETURNS

Returns a [DeferredWidgetBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/deferredwidgetbuilder) instance.

### HtmlAttributes(System.Object)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Object`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Object`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### Render()

Renders the component in place.

### ToHtmlString()

Returns the HTML representation of the component.

### WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToClientTemplate()

Returns the client template for the component.

### AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

#### Parameters

##### value - `System.Boolean`

#### RETURNS

Returns the current  instance.
