We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Display appointments at start and end of month

Hi

I am using your Schedule component in month view mode.

If the 1st of a month starts for example on a thursday then no appointments are shown for the sunday to wednesday ( they are in the previous month ). The same thing applies at the end of the month.
Is it possible to display the appontments from the beginning of the week ? ie fill up the 1st and last week of the view )

Regards

Martin Hoyle

7 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team May 31, 2017 09:24 AM UTC

Hi Martin, 
 
Thank you for contacting Syncfusion support. 
 
We suspect that ShowNextPrevMonth API is set to false in your sample, therefore only other month days and appointments were hidden from the current month on the Schedule. If that was your case kindly set it to true else share image/video demo/code example/sample(if possible) to proceed further. 
 
Regards, 
Karthigeyan 



MH Martin Hoyle June 1, 2017 09:57 AM UTC

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;
            }


KK Karthigeyan Krishnamurthi Syncfusion Team June 2, 2017 05:18 AM UTC

Hi Martin,    
  
Thanks for your update. 
 
By default, at controller function, time zone value will be subtracted from the current date time, therefore only current date is retrieved as May 31st when the Scheduler current date is set to June 1st. We request you to convert the current date time to local time by adding its hours and minutes values based on your time zone value before the filtering process.  
  
Regards,  
Karthigeyan  



MH Martin Hoyle June 5, 2017 07:09 PM UTC

Hi

In the controller getdata function the CurrentDate parameter has the Kind property set to Local - is this an error and infact it is UTC time.
If so what is the recommended way of converting to the correct datetime?

Regards

Martin Hoyle


KK Karthigeyan Krishnamurthi Syncfusion Team June 6, 2017 05:40 AM UTC

Hi Martin,  
  
Thanks for your update.  

By default, at controller function, time zone value will be subtracted from the current date time and we suspect that your timezone is UTC+1, therefore kindly use the below code example to add the timezone value to the current date before the filtering process. 

<Code> 
CurrentDate.AddHours(1) // 1 represent your time zone  
</Code> 
 
Regards,  
Karthigeyan  



MH Martin Hoyle June 8, 2017 04:33 PM UTC

Hi

Ok thanks

Regards

Martin



KK Karthigeyan Krishnamurthi Syncfusion Team June 9, 2017 04:48 AM UTC

Hi Martin,   
 
Thanks for your update. 
 
Regards, 
Karthigeyan 


Loader.
Up arrow icon