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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Display appointments at start and end of month

Thread ID:

Created:

Updated:

Platform:

Replies:

130737 May 30,2017 01:13 PM UTC Jun 9,2017 04:48 AM UTC ASP.NET MVC 7
loading
Tags: Schedule
Martin Hoyle
Asked On May 30, 2017 01:13 PM UTC

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

Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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 


Martin Hoyle
Replied On 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;
            }

Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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  


Martin Hoyle
Replied On 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

Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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  


Martin Hoyle
Replied On June 8, 2017 04:33 PM UTC

Hi

Ok thanks

Regards

Martin


Karthigeyan Krishnamurthi [Syncfusion]
Replied On June 9, 2017 04:48 AM UTC

Hi Martin,   
 
Thanks for your update. 
 
Regards, 
Karthigeyan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;