Events not Rendering on Heroku Website, but Only Local

I followed a SyncFusion tutorial to deploy my ASP.NET MVC website on Heroku. The app is connected to Heroku PostgresQL database.

Here is what is looks like from my machine(visual studio):

pic.PNG

When I run my program locally on my machine, the ListView Object, user log in Objects and even the Scheduler Object data pulls/renders correctly.

Please help me understand why the events do not render?


However, my heroku website doesn't render any events on the scheduler. The ListView and User logins are able to interact with the database correctly.

Here is what is looks like on the website:

pic2.PNG

Here is the Github repo.

Below is the code snipper for the scheduler. I should add, none of the events related to appointment data fire off. The "onEventRendered" or "onActionFailure" does not activate.

@(Html.EJS().Schedule("schedule")

.Width("100%")

.Height("700px")

.Group(group => group.Resources(ViewBag.Resources))

.Resources(res => {res.DataSource(ViewBag.Owners)

.Field("QueueId")

.Title("Owners")

.Name("Owners")

.TextField("QueueName")

.IdField("Id")

.ColorField("Color")

.Add();

})

.Views(view => {view

.Option(View.TimelineDay)

.AllowVirtualScrolling(true)

.Add();

})

.TimeScale(ts => ts

.Enable(true)

.Interval(60)

.SlotCount(6)

)

.EventSettings(e => e.DataSource(

d => d

.Url("GetScheduleData")

.CrudUrl("UpdateScheduleData")

.Adaptor("UrlAdaptor")

.CrossDomain(true)

)

.EnableTooltip(true)

)

.AllowDragAndDrop(false)

.AllowResizing(false)

.ActionBegin("onActionBegin")

.EventRendered("onEventRendered")

.ActionFailure("onActionFailure")

.PopupOpen("onPopupOpen")

.PopupClose("onPopupClose")

.EditorTemplate("#EventEditorTemplate")

.ShowQuickInfo(false)

.Render()

)


Please help me understand why the events do not render?


5 Replies 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team May 20, 2022 03:03 PM UTC

Hi Kevin,


Greetings from Syncfusion support.


We have validated your query “Please help me understand why the events do not render?” at our end. In the selected date range there are no events present in the DB. So, we are getting the result appointment length as 0 in the dataBinding event of the Schedule. So, we suggest you make sure the appointments are present in the respective date range in your DB that is connected with the Schedule.



Kindly let us know if you need any further assistance.


Regards,

Ravikumar Venkatesan



KV Kevin V May 20, 2022 03:21 PM UTC

Ravikumar,


Thank you for looking into this.


This is definitely odd, I checked the heroku database the scheduler is connected to for the date of 5/18/2022(see highlight):2022-05-20 08_14_58-Clipboard.png


I looked at the 1st item highlighted and can check that it appears when I run the program locally(see highlight):

2022-05-20 08_19_21-Clipboard.png


Does the scheduler data correctly appear when you run the program locally vs. deployed?


Thank




RV Ravikumar Venkatesan Syncfusion Team May 23, 2022 04:09 PM UTC

Hi Kevin,


Thanks for the update.


Q1: Events not Rendering on Heroku Website, but Only Local


We have validated your above query at our end. Due to the local offset applied to the GetScheduleData method StartDate parameter, the data filtering from DB returns empty data. So, we suggest you use the below-highlighted change to resolve the problem.


[HeijunkaController.cs]

        public ActionResult GetScheduleData([FromBody] GetParams param)

        {

            // Obtain Existing Parts in Process Data

            var date = param.StartDate.ToUniversalTime().Date;

            var data = _db.GetScheduleData(date);

            return Json(data);

        }


Q2: Does the scheduler data correctly appear when you run the program locally vs. deployed?


In local, the data is returned from the server based on the Scheduler selected date. So, the Scheduler renders the appointments. But in deployed site, the empty data is returned from the server due to the local timezone offset. So, the Scheduler doesn’t render any appointments.


Kindly try the shared solution and let us know if you need any further assistance.


Regards,

Ravikumar Venkatesan


Marked as answer

KV Kevin V May 23, 2022 05:42 PM UTC

Ravikumar,


Yes! That greatly aided in the solution! Experimenting more with your solution allowed me to see that somehow looking at my sql statement:


"SELECT .......  WHERE @date = Date(StartDate)". Is interpreted differently(?) when deployed onto Heroku.


I just got rid of that condition and then specified to obtain any and all data.


After dealing with that, I did see that all my timezones were offset, and needed the code you supplied to addrtess 



SK Satheesh Kumar Balasubramanian Syncfusion Team May 24, 2022 10:47 AM UTC

Hi Kevin,

Thanks for the update.

We are happy that your problem has been resolved now.

Regards,
Satheesh Kumar B

Loader.
Up arrow icon