Issue 2400: $.fullCalendar.formatDate() crashing app?
Status:  Invalid
Owner: ----
Closed:  Jan 2015
Reported by psph...@gmail.com, Dec 29, 2014
I'm trying to use the formatDate function to store an event in a SQL database, but it keeps crashing when setting "var start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");" Any ideas?

Here's the full code for the part that's crashing:
select: function(start, end, allDay) {
   var title = prompt('Event Title:');
   //var url = prompt('Type Event url, if exits:');
   if (title) {
   var start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");
   var end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss");
   $.ajax({
   url: 'add_events.php',
   data: 'title='+ title+'&start='+ start +'&end='+ end +'&url='+ url ,
   type: "POST",
   success: function(json) {
   alert('Added Successfully');
   }
   });
   calendar.fullCalendar('renderEvent',
   {
   title: title,
   start: start,
   end: end,
   allDay: allDay
   },
   true // make the event "stick"
   );
   }
   calendar.fullCalendar('unselect');
   },
Jan 6, 2015
Project Member #1 adamrs...@gmail.com
Hmm, I'm not sure. The freezing might be due to infinite recursion related to calling select/unselect. Could you post a recreation? Would make it a lot easier to debug.
http://fullcalendar.io/wiki/Reporting-Bugs/

Realistically, if this is a bug with FullCalendar's code, the likelihood of it getting fixed is pretty low, considering that nobody else has reported this, and it's a legacy version with  a legacy date system (v2 and above uses moment).

But if you post a recreation, we could go from there.
Status: Invalid
Jan 6, 2015
#2 psph...@gmail.com
 found the issue, it was that I was using $.fullCalendar.formatDate( when that is no longer supported.
Jan 6, 2015
Project Member #3 adamrs...@gmail.com
cool