Hi
I have sorted the problem but I have another issue. The date today is 1st June.
I am using the load on demand mode and in my controller action the currentdate received is the 31st
This means that after the switch statement in month view the start and end dates are wrong. It works fine if the date is not the 1st.
public JsonResult GetData(DateTime CurrentDate, String CurrentView, String CurrentAction,Boolean can)
{
DateTime CurrDate = CurrentDate;
DateTime StartDate = FirstWeekDate(CurrDate.Date);
DateTime EndDate = FirstWeekDate(CurrDate.Date);
switch (CurrentView)
{
case "day":
StartDate = CurrDate;
EndDate = CurrDate.AddDays(1);
break;
case "week":
EndDate = EndDate.AddDays(7);
break;
case "workweek":
EndDate = EndDate.AddDays(5);
break;
case "month":
StartDate = AddDays(-CurrDate.Day + 1);
EndDate = StartDate.AddMonths(1);
break;
}