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());
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With