public IActionResult GetBookedData([FromServices] IOptions <CalendarGeneratorConfiguration> calendarGenConfig) { var calendarGenerator = new CalendarGenerator(calendarGenConfig.Value.Language, calendarGenConfig.Value.UtcDelta); var bvm = new BookingViewModel { DaysOfWeek = calendarGenerator.GetDays(), CalendarData = calendarGenerator.GetCalendarGrid(4) }; return(View(bvm)); }
public IActionResult CalendarShift([FromServices] IOptions <CalendarGeneratorConfiguration> calendarGenConfig) { var r = new StreamReader(HttpContext.Request.Body).ReadToEnd(); var calendarGenerator = new CalendarGenerator(calendarGenConfig.Value.Language, calendarGenConfig.Value.UtcDelta); var bvm = new BookingViewModel { DaysOfWeek = calendarGenerator.GetDays(), CalendarData = calendarGenerator.GetCalendarGrid(4, Convert.ToInt16(r)) }; var rw = Json(bvm); var rrr = new JsonResult(bvm); return(Json(rrr)); }