File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Picking Only Months
3
+ description : How to select only months, not dates in the date picker
4
+ type : how-to
5
+ page_title : Pick Only Months
6
+ slug : datepicker-kb-select-months-only
7
+ position :
8
+ tags :
9
+ ticketid : 1513216
10
+ res_type : kb
11
+ ---
12
+
13
+ ## Environment
14
+ <table >
15
+ <tbody>
16
+ <tr>
17
+ <td>Product</td>
18
+ <td>DatePicker for Blazor</td>
19
+ </tr>
20
+ </tbody>
21
+ </table >
22
+
23
+
24
+ ## Description
25
+ 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.
26
+
27
+ Is it possible to get a DatePicker that shows a popup with only month/year selection?
28
+
29
+ ## Solution
30
+ 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.
31
+
32
+ You can also set a ` Format ` that shows the month and year only too.
33
+
34
+ Here is an example of both:
35
+
36
+
37
+ ```` CSHTML
38
+ @selectedDate
39
+ <br />
40
+ <TelerikDatePicker @bind-Value="@selectedDate"
41
+ BottomView="@CalendarView.Year"
42
+ Format="MMM yy">
43
+ </TelerikDatePicker>
44
+
45
+ @code{
46
+ DateTime selectedDate { get; set; } = DateTime.Now;
47
+ }
48
+ ````
You can’t perform that action at this time.
0 commit comments