Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
FullCalendar v5 not rendering event from PHP JSON return

I am using FullCalendar v5 (as I am developing the website using a template using v5). The following are the code in my frontend file to initiating the calendar:

var date = new Date()
var d = date.getDate(),
    m = date.getMonth(),
    y = date.getFullYear()

var Calendar = FullCalendar.Calendar;
var calendarEl = document.getElementById('calendar');

// initialize the external events
// -----------------------------------------------------------------
var calendar = new Calendar(calendarEl, {
    headerToolbar: {
        left: 'prev,next,today',
        center: 'title',
        right: ''
    },
    themeSystem: 'bootstrap',
    events: {
        url: '/load/load_event.php,
        method: 'GET',
        failure: function () {
            alert('there was an error while fetching events!');
        }
    }
});
calendar.render(); 

And the JSON return for the load_event.php is as follows:

[
  {
    "id": 1,
    "Title": "Not Available",
    "Start": "2022-07-21",
    "End": "2022-08-05",
    "backgroundColor": "#FF0000",
    "borderColor": "#FF0000"
  }
] 

I can render the calendar without problem, but the event is not showing on my calendar, is there something I missed?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

your JSON is ok, but the field names are incorrect, specifically the casing of Title, Start and End, which need to be title, start and end

[{"id":1,"title":"Not Available","start":"2022-07-21","end":"2022-08-05","backgroundColor":"#FF0000","borderColor":"#FF0000"}]

once corrected it works great working example

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda