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

181
Vistas
How to get data from fetch in fullcalendar events?

i am trying to show my own data in calendar events via fetch. This is my code:

<script>
export default {
     data() {
       return {
         fechadatos: []
       }
     },
   async created() {
   // GET request using fetch with async/await
   const response = await fetch("http://127.0.0.1:8000/apifechaClase/");
   const data = await response.json();
   this.fechadatos = data[0]
     },
mounted() {
   document.addEventListener('DOMContentLoaded', function () {
   const calendarEl = document.getElementById('calendar');
   const calendar = new FullCalendar.Calendar(calendarEl, {
    headerToolbar: {
        left: 'prev,next today',
        center: 'title',
        right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
    },
    initialView: 'dayGridMonth',
    initialDate: '2020-09-12',
    navLinks: true, // can click day/week names to navigate views
    selectable: true,
    nowIndicator: true,
    dayMaxEvents: true, // allow "more" link when too many events
    editable: true,
    businessHours: true,
    events: [{
        title: 'All Day Event',
        start: '2020-09-01',
    }, {
        title: 'Long Event',
        start: '2020-09-07',
        end: '2020-09-10'
    }]
});
calendar.render();
});
 }
 }
 </script>

The problem is that i don't know how to put my info in to calendar events:

    events: [{
    title: var.from.api,
    start: var.from.api,
}, {
    title: var.from.api,
    start: var.from.api,
    end: var.from.api
}]

something like that (?) i don't know how to get the api info to show it.

about 4 years ago · Juan Pablo Isaza
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