CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Javascript - fullCalendar

Flox95
Flox95
Niveau 5
27 mai 2017 à 21:33:33

Salut!

J'utilise fullCalendar pour afficher des événements dans un calendrier mais j'ai cette erreur :


Uncaught TypeError: Cannot read property 'hasTime' of undefined
    at normalizeEventTimes (fullcalendar.js:12634)
    at normalizeEventDates (fullcalendar.js:12614)
    at assignDatesToEvent (fullcalendar.js:12605)
    at buildEventFromInput (fullcalendar.js:12589)
    at fullcalendar.js:12180
    at Function.map (jquery-3.1.1.js:457)
    at buildEventSource (fullcalendar.js:12179)
    at Array.<anonymous> (fullcalendar.js:11835)
    at Function.each (jquery-3.1.1.js:368)
    at Calendar_constructor.EventManager (fullcalendar.js:11832)

Voici mon code :



$(document).ready(function() {

	getEvents();

});

function getEvents(){
	
	// Récupération des infos serveur
	var server_dns = $("#server_dns").html();
	
	// Envoi de la requête
	var xhr = new XMLHttpRequest();
	xhr.open("GET", server_dns+"/event");
	xhr.send("");
	
	// Attente de la réponse
	xhr.onreadystatechange = function(){
		if (xhr.readyState == xhr.DONE) {
			
			// Réponse correcte
			if(xhr.status == 200){
				
				console.log(xhr.responseText);

				$('#calendar').fullCalendar({
				    events: [xhr.responseText]
				});
			}
			
		}
	}
}

Je pense que l'erreur ne viens pas de mon JSON car la console me donne :



{title: 'test',start: '2017-05-26T12:13:00'},{title: 'test',start: '2017-06-02T12:13:00'},{title: 'test',start: '2017-06-09T12:13:00'},{title: 'test',start: '2017-06-16T12:13:00'},{title: 'test',start: '2017-06-23T12:13:00'},{title: 'test',start: '2017-06-30T12:13:00'},{title: 'test',start: '2017-07-07T12:13:00'},{title: 'test',start: '2017-07-14T12:13:00'},{title: 'Test2',start: '1995-04-22T22:22:00'},{title: 'Test2',start: '1995-04-29T22:22:00'},{title: 'Test2',start: '1995-05-06T22:22:00'},{title: 'Test2',start: '1995-05-13T22:22:00'},{title: 'Test2',start: '1995-05-20T22:22:00'},{title: 'Test2',start: '1995-05-27T22:22:00'},{title: 'Test2',start: '1995-06-03T22:22:00'},{title: 'Test2',start: '1995-06-10T22:22:00'},{title: 'TEST3',start: '2017-05-27T12:00:00'},{title: 'TEST3',start: '2017-06-03T12:00:00'},{title: 'TEST3',start: '2017-06-10T12:00:00'},{title: 'TEST3',start: '2017-06-17T12:00:00'},{title: 'TEST3',start: '2017-06-24T12:00:00'},{title: 'TEST3',start: '2017-07-01T12:00:00'},{title: 'TEST3',start: '2017-07-08T12:00:00'},{title: 'TEST3',start: '2017-07-15T12:00:00'},{title: 'TEST3',start: '2017-07-22T12:00:00'},{title: 'TEST4',start: '2018-12-10T10:10:00'},{title: 'TEST4',start: '2018-12-17T10:10:00'}

Je suis un peu perdu

Sous forums
  • Aide à l'achat Mac
  • Création de Jeux
  • Linux
  • Création de sites web
  • Programmation
  • Internet
  • Steam Deck
  • Macintosh
  • Hardware
La vidéo du moment