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

133
Vistas
How to apply colours for each events in full calendar js?

I want to show multiple events with different colour for each. Here two ajax response have displayed in calendar. But all the events shows only green. The Second events also visible in green colour. How to show each events with different colours?

My code is as follows:

$('#calendar').fullCalendar({

      events: function(start, end, timezone, callback) {
         $.ajax({
            url: url1,
            dataType: 'json',
            success: function(response) {
                 var events = [];
              $(response.data).each(function() {
                 events.push({
                  title: $(this).attr('title'),
                  start: $(this).attr('start'), // will be parsed
                  color: 'green'
                 });
              });
             callback(events);
            }
         });
         $.ajax({
            url: url2,
            dataType: 'json',
            success: function(response) {
                 var events = [];
              $(response.data).each(function() {
                 events.push({
                  title: $(this).attr('title'),
                  start: $(this).attr('start'), // will be parsed
                  color: 'red'
                 });
              });
             callback(events);
            }
         });
       }
       
   });
over 4 years ago · Santiago Trujillo
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