Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

120
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda