This is a migrated thread and some comments may be shown as answers.

Picking Only Months

2 Answers 204 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Drewanz
Top achievements
Rank 1
Veteran
Drewanz asked on 29 Mar 2021, 08:36 PM

An app needs to process data for the month - is there a way to use DatePicker and choose only the Month/Year ?? Displaying it is quite easy with Format.

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 30 Mar 2021, 06:35 AM

Hello Drewanz,

You can use the BottomView to limit how far down the user can go to. If they can go down only to the Year view they will effectively select months.

You can also set a Format that shows the month and year only too.

Here is an example of both:

@selectedDate
<br />
<TelerikDatePicker @bind-Value="@selectedDate"
                   BottomView="@CalendarView.Year"
                   Format="MMM yy">
</TelerikDatePicker>

@code{
    DateTime selectedDate { get; set; } = DateTime.Now;
}

 

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Drewanz
Top achievements
Rank 1
Veteran
answered on 30 Mar 2021, 10:23 PM
PERFECT !
Many thanks!
Tags
DatePicker
Asked by
Drewanz
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Drewanz
Top achievements
Rank 1
Veteran
Share this question
or