# Selecting Week Days in the DatePicker

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Telerik UI for ASP.NET MVC DatePicker</td>
 </tr>
 <tr>
  <td>Progress Telerik UI for ASP.NET MVC version</td>
  <td>Created with the 2022.3.913 version</td>
 </tr>
</table>

## Description

How can I select the days of the week from the Telerik UI for ASP.NET MVC DatePicker?

## Solution

1. Hide the initially rendered days of the week within the Popup Calendar of the DatePicker for Telerik UI for ASP.NET MVC.
2. Create a flag variable which will hold the days of the week.
3. To select the days of the week, handle the [`.MonthTemplate()`](https://docs.telerik.com/aspnet-mvc/api/kendo.mvc.ui.fluent/datepickerbuilder#monthtemplatesystemstring) and pass the current date as an argument.
4. Within the function handler, parse the date argument to a [`Date`](https://www.w3schools.com/js/js_dates.asp) object. To get the current day, use the [`.getDay()`](https://www.w3schools.com/jsref/jsref_getday.asp) method and obtain it from the previously defined flag variable.

```Razor Index.cshtml
    @(Html.Kendo().DatePicker()
          .Name("datepicker")
          .Value(DateTime.Today)
          .Footer("Today - #=kendo.toString(data, 'd') #")
          .MonthTemplate(month => month.Content("#= getDays(date) #"))
    )
```

```JS script.js
    <script>
        var weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; // Create a flag variable for the days of the week.

        function getDays(date){
            var parsedDate = new Date(date); // Parse the date argument.

            var weekday = weekdays[parsedDate.getDay()]; // Get the current week day from the previously defined flag variable.

            return weekday;
        }  
    </script>
```

```C# Styles.css
    <style>
    /* Popup window size week headers.*/
    .k-calendar-thead > .k-calendar-tr
    {
        display:none;
    }

    /* Popup window size. */
    .k-calendar .k-calendar-view {
        width: 330px;
        padding: 0px;
        font-size:10px;
    }
    </style>

```

For the complete implementation of the suggested approach, refer to the [Telerik REPL example on selecting the days of the week within the DatePicker](https://netcorerepl.telerik.com/mGbauybw5279RlE740).

## More ASP.NET MVC DatePicker Resources

* [ASP.NET MVC DatePicker Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/datepicker/overview)

* [ASP.NET MVC DatePicker Demos](https://demos.telerik.com/aspnet-mvc/datepicker/index)

* [ASP.NET MVC DatePicker Product Page](https://www.telerik.com/aspnet-mvc/datepicker)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Telerik REPL: Select the Current Days of the Week in the DatePicker](https://netcorerepl.telerik.com/mGbauybw5279RlE740)
* [Client-Side API Reference of the DatePicker for ASP.NET MVC](https://docs.telerik.com/kendo-ui/api/ui/datepicker)
* [Server-Side API Reference of the DatePicker for ASP.NET MVC](https://docs.telerik.com/aspnet-mvc/api/datepicker)
* [Telerik UI for ASP.NET MVC Breaking Changes](https://www.telerik.com/aspnet-mvc/documentation/backwards-compatibility/2023-backwards-compatibility)
* [Telerik UI for ASP.NET MVC Knowledge Base](https://docs.telerik.com/aspnet-mvc/knowledge-base)
