You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
This is my CalendarController.php, $response has stored the JSON file of my events.
`<?php
namespace ADesigns\CalendarBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use ADesigns\CalendarBundle\Event\CalendarEvent;
class CalendarController extends Controller
{
/**
* Dispatch a CalendarEvent and return a JSON Response of any events returned.
*
* @param Request $request
* @return Response
*/
public function loadCalendarAction(Request $request)
{
$startDatetime = new \DateTime();
$startDatetime->setTimestamp($request->get('start'));
$endDatetime = new \DateTime();
$endDatetime->setTimestamp($request->get('end'));
$events = $this->container->get('event_dispatcher')->dispatch(CalendarEvent::CONFIGURE, new CalendarEvent($startDatetime, $endDatetime, $request))->getEvents();
$response = new \Symfony\Component\HttpFoundation\Response();
$response->headers->set('Content-Type', 'application/json');
$return_events = array();
foreach($events as $event) {
$return_events[] = $event->toArray();
}
$response->setContent(json_encode($return_events));
return $response;
}
} Im dont know how you retrieve the JSON encode file on the js file$(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar-holder').fullCalendar({
header: {
left: 'prev, next',
center: 'title',
right: 'month,'
},
lazyFetching: true,
timeFormat: {
// for agendaWeek and agendaDay
agenda: 'h:mmt', // 5:00 - 6:30
// for all other views
'': 'h:mmt' // 7p
},
eventSources: [
{
url: Routing.generate('fullcalendar_loader'),
type: 'GET'
data: {
filter: 'my_custom_filter_param'
},
error: function() {
//alert('There was an error while fetching Google Calendar!');
}
}
]
});
});`
Any help would be appreciated, Thanks
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is my CalendarController.php, $response has stored the JSON file of my events.
`<?php
namespace ADesigns\CalendarBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use ADesigns\CalendarBundle\Event\CalendarEvent;
class CalendarController extends Controller
{
/**
* Dispatch a CalendarEvent and return a JSON Response of any events returned.
*
* @param Request $request
* @return Response
*/
public function loadCalendarAction(Request $request)
{
$startDatetime = new \DateTime();
$startDatetime->setTimestamp($request->get('start'));
}
Im dont know how you retrieve the JSON encode file on the js file
$(function () {var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
});`
Any help would be appreciated, Thanks
The text was updated successfully, but these errors were encountered: