Hi, I'm experiencing this problem in Vue.
this.$refs.scheduler.getCurrentViewDates() is empty onCreated()
Hi,
I think, getcurrentViewDates() method is not usable in every scenario. Assume that view is set to month and start and end dates set to November. In this case calendar will also display 31 October and 01, 02 Decembers and getcurrentViewDates() will also return these dates. But this may be not what you want. I only want to load events of November so I need precise month start and end dates. Currently there seems to be no way to do it if you use build-in navigation.
Hi Deniz,
Greetings from Syncfusion support.
We have validated your query “I only want to load events of November so I need precise month start and end dates” at our end. The Schedule will send the start and end dates of the selected date range to the server end. If you want only the selected month's data you can fetch them alone with the help of the code snippet shown below.
Sample: https://stackblitz.com/edit/ej2-angular-schedule-url-adaptor-sample?file=app.component.ts
[HomeController.cs]
public JsonResult LoadData(Params param) // Here we get the Id value we added in the dataQuery { DateTime start = param.StartDate; DateTime end = param.EndDate; if (param.StartDate.Month != param.EndDate.Month) { if (param.StartDate.Day == 1) { end = start.AddMonths(1); } else { var previousMonth = new DateTime(param.StartDate.Year, param.StartDate.Month, 1); start = previousMonth.AddMonths(1); end = start.AddMonths(1); } } var data = db.ScheduleEventDatas.Where(app => (app.StartTime >= start && app.StartTime <= end)).ToList(); return Json(data, JsonRequestBehavior.AllowGet); } |
Kindly try the shared solution and let us know if you need any further assistance on this.
Regards,
Ravikumar Venkatesan