3

I have created fullcalendar with scheduler. I have created an eventClick like this in it:

eventClick:  function(event, jsEvent, view) {
                var start = event.start;
                var stop = event.end;
                openModal(start, stop);
                }

When I check start and stop, they are nothing but objects. How can I retrieve start and stop dates from here? I was able to get title and other things from here

  • please provide the event object – danday74 Sep 20 '18 at 22:47
  • @danday74 Can you please tell me how can I copy the event object from console? It's a long list of objects. –  Sep 20 '18 at 22:56
  • ok dont worry, is there anything in it that looks like a date or a long number like this .... 4234543423142 ... this is a timestamp which can be converted to a date ... timestamps are often used to determine lapsed time by deducting the start timestamp from the end timestamp and then converting it to a human readable duration or human readable dates – danday74 Sep 20 '18 at 22:57
  • Interesting question, I don't know a ton about fullCalendar but according to their documentation the start/end SHOULD be there. The closest issue after a short google search I can find is this - https://github.com/fullcalendar/fullcalendar/issues/3491 - is that at all similar to your situation? – Rose Robertson Sep 20 '18 at 23:03
  • 1
    the dates are momentJS objects. The fullCalendar docs explain that they use momentJS objects throughout to store dates. So `start.format()` will make it a readable string for instance. Or you can make a custom format. See http://momentjs.com/docs/#/displaying/ – ADyson Sep 21 '18 at 07:28
  • See also https://fullcalendar.io/docs/moment where the fullCalendar documentation explains about its use of momentJS – ADyson Sep 21 '18 at 11:46
  • @danday74 Thank You, we can use event.start.format(). It will display the date –  Sep 22 '18 at 17:13
  • 1
    @Rose It's not an issue. We need to use momentjs .format() because fullcalendar depends on momentjs. Thank you for the support. –  Sep 22 '18 at 17:14
  • @ADyson. Yes. We need to use this. Thanks a lot. –  Sep 22 '18 at 17:15

0 Answers0