|
<ejs-datepicker id="datepicker" renderDayCell="customDates" cssClass="e-customStyle"open="onOpen"></ejs-datepicker>
<script>
function onOpen() {
this.navigateTo(this.start, new Date("1/1/2016"))// navigate to the default start view of the specifed date object
} </script> |
Hello,
I was looking also to implement this fucntionality and downloaded the sample project.
When I run the project I can see tooltip text added but the format is the same as other day. The color in the style classes has not effect on the DatePicker.
We are using the current version of the DatePicker so probably the classes has change, if that the case could please update the sample project ?
Regards,
Arsenio
|
@using Syncfusion.EJ2
@section ControlsSection{
<div class=" control-section">
<div id="wrapper" class="datepicker-section">
<div id="datepicker-control">
<ejs-datepicker id="datepicker" value="ViewBag.value" renderDayCell="customDates" cssClass="e-customStyle"></ejs-datepicker>
</div>
</div>
</div>
}
<script>
var addClass = ej.base.addClass;
function customDates(args) {
/*Date need to be customized*/
var span;
if (args.date.getDate() === 10) {
specialDate(args, "Birthday");
}
if (args.date.getDate() === 15) {
specialDate(args, "Farewell");
}
if (args.date.getDate() === 25) {
specialDate(args, "Vacation");
}
}
function specialDate(args, name) {
span = document.createElement('span');
span.setAttribute('class', 'e-icons highlight');
args.element.firstElementChild.setAttribute('title', name + '!');
addClass([args.element], ['e-day', 'special', name.toLowerCase()]);
args.element.setAttribute('data-val', name + '!');
args.element.setAttribute('title', name + '!');
args.element.appendChild(span);
}
</script> |