I am using kendo DateTimePicker and just don't want user to select from Weekends.
I have tried assigning MonthTemplate() aproach as follows:
@(Html.Kendo().DateTimePickerFor(m => Data)
.MonthTemplate("# if (isWeekDay(data.date)) { #" +
"#= data.value #" +
"# } #"
)
function isWeekDay(date)
{
var day = date.getDay();
return (day % 6 != 0);
}
But it helped me for just not displaying the Date in the Widget, but user still able to select it by clicking over the blank Cell in the Month Template.
Tried using Validation handling onChange Event and (e.StopPropagation for not closing the dropdown), but still its working.
Is it possible or doing efforts invain?
Thanks Sumeet
I am using kendo DateTimePicker and just don't want user to select from Weekends.
I have tried assigning MonthTemplate() aproach as follows:
@(Html.Kendo().DateTimePickerFor(m => Data)
.MonthTemplate("# if (isWeekDay(data.date)) { #" +
"#= data.value #" +
"# } #"
)
function isWeekDay(date)
{
var day = date.getDay();
return (day % 6 != 0);
}
But it helped me for just not displaying the Date in the Widget, but user still able to select it by clicking over the blank Cell in the Month Template.
Tried using Validation handling onChange Event and (e.StopPropagation for not closing the dropdown), but still its working.
Is it possible or doing efforts invain?
Thanks Sumeet
Share Improve this question asked May 22, 2013 at 19:12 SumeetSumeet 9151 gold badge14 silver badges32 bronze badges 2- Looking for something like we have in Jquery dateTimepicker: $("#datepicker").datepicker({ beforeShowDay: $.datepicker.noWeekends }); – Sumeet Commented May 22, 2013 at 19:33
- Friends, is somethign wrong with my question. Its been more than 24 hrs and this is not able to catch even a single attention? Am I doing things pletely wrong or there is something wrong in stating my problem. Please guide me.. – Sumeet Commented May 23, 2013 at 21:03
1 Answer
Reset to default 6Hope you still need help about your question. This is a way to disable click on weekends.
.kendoDatePicker({
open: function() { $('.k-weekend a').bind('click', function() { return false; }); }
});
.k-weekend is the class associated to weekend cells. So, it's easy to disable the click on those cells. It's also possible to put some CSS to change the aspect of those cells.
Hope this will help. Laurent
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745342180a4623377.html
评论列表(0条)