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

Legend for DatePicker

4 Answers 221 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 25 May 2016, 05:48 PM

Hi,

I'm new to a .NET web app project that is using a DatePicker to switch between report dates (also new to Telerik's products as well).  Need to add a feature that highlights dates that have available reports.  

My question is: How do I add a legend to the calendar that says something like "Highlighted dates have reports available" either above or below where today's date is displayed?  When the calendar icon is clicked, the calendar drops down, but I can't seem to figure out how to put a legend/key on the calendar.  As far as I can tell, here is the code generating the attached DatePicker:

- In a .cshtml file:

@model DateTime?
 
<span style="width:6em">
    @(Html.Kendo().DatePickerFor(m => m).Format("yyyy-MM-dd"))
</span>

 

- And the call in another .cshtml file:

<td>@Html.EditorFor(m => m.ProdDate)</td>

 

Thanks for the help.

4 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 27 May 2016, 11:10 AM
Hi Bryan,

In order to highlight some of the dates in the calendar popup you can use a template. Check out the following example that outlines the approach:



Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bryan
Top achievements
Rank 1
answered on 27 May 2016, 03:42 PM
Thanks for the tip on highlighting, Viktor.  Is there a demo for putting a legend/key on a calendar (my original question) as well?  My thought is to do it in a modal/popup, but the users would prefer not needing an additional popup, so putting the legend on the drop-down calendar (if possible) is ideal.
0
Viktor Tachev
Telerik team
answered on 30 May 2016, 10:48 AM
Hi Bryan,

In order to add custom text in the footer of the calendar popup you can handle the open event for the DatePicker. In the handler you can get reference of the footer and add your custom message.


open: function (e) {
   
  var picker = this;
  setTimeout(function() {
    picker.dateView.popup.wrapper.find(".k-footer").append("Custom text");
  }, 1);
   
}



Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bryan
Top achievements
Rank 1
answered on 13 Jun 2016, 08:22 PM
Disregard
Tags
Date/Time Pickers
Asked by
Bryan
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Bryan
Top achievements
Rank 1
Share this question
or