Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the event time from an event click in fullcalendar

I have an eventclick event in fullcalendar and it returns the details about the event which includes the date and time. How do I just get the time? ex 6:00:00 am

Here is a fiddle I'm using.

I'm trying .time() because the documentation says start is a moment like object and the moment object has a method called .time()

eventClick: function (calEvent, jsEvent, view) { 
        alert(calEvent.start.time());
    }
like image 276
user1186050 Avatar asked Dec 20 '25 17:12

user1186050


1 Answers

You need to install the plugin moment.js

Than you can use

eventClick: function (calEvent, jsEvent, view) { alert(moment(calEvent.start).format('h:mm:ss a')); }

Fiddle

like image 167
Hakan Kose Avatar answered Dec 22 '25 08:12

Hakan Kose



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!