Пример #1
0
        public JsonResult GetEvents()
        {
            var activities = _vacreqService.GetAllAcceptedEvents();

            foreach (var item in activities)
            {
                item.url = Url.Action("Details", "Verlofaanvraag", new { id = item.id });
            }
            var holidays = _holService.GetHolidaysForCalendar();

            foreach (var item in holidays)
            {
                activities.Add(item);
            }

            foreach (var item in activities)
            {
                item.start = item.start.AddHours(DateTime.Now.Hour - DateTime.UtcNow.Hour);
                item.end   = item.end.AddHours(DateTime.Now.Hour - DateTime.UtcNow.Hour);
            }

            return(Json(activities, JsonRequestBehavior.AllowGet));
        }