Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fullcalendar time format

Good afternoon, I know that this topic has been discussed on previous ocassions, nevertheless despite the different threads I still can't solve my problem. I am using the full calendar provided at http://arshaw.com/fullcalendar/, and they have two ways of displaying time, "10:30a"-"7p", for example. I want the time displayed on the calendar of events that are not full day, in a format "12:00 pm" or "12:00 am". The problem i'm having is, when you download the fullcalendar you have several files:

fullcalendar.js, fullcalendar.css, fullcalendar.min.js, fullcalendar.print.css, gcal.js, jquery-1.9.1.min, jquery-ui-1.10.2.custom.min

I tried what other threads suggest, which is a change in the fullcalendar.js at the time format and setdefault methods but to no avail. I can even delete the file "fullcalendar.js" and my test still works just fine. I want to know why is this and if the time format is not managed there, where is it managed? Thanks

like image 483
Ricardo Avatar asked Apr 12 '13 18:04

Ricardo


People also ask

How do you date in FullCalendar?

Calendar::getDate Returns a Date for the current date of the calendar. For month view, it will always be some time between the first and last day of the month.

How do I change the date on FullCalendar?

The calendar's dates can change any time the user does the following: click the prev/next buttons, change the view, click a navlink. The dates can also change when the current-date is manipulated via the API, such as when gotoDate is called. datesSet is called after the new date range has been rendered.

How do I start and end date in FullCalendar?

We can get start date by getView event with intervalStart. We can get end date by getView event with intervalEnd. var month = $('#calendar'). fullCalendar('getView').

What is FullCalendar?

FullCalendar is a JavaScript library that seamlessly integrates with such popular JavaScript frameworks as Vue, React, Angular. Thanks to its excellent documentation, one won't have trouble incorporating the library into projects.


3 Answers

Use this and it's going to work:

$('#calendar').fullCalendar({
 timeFormat: 'hh:mm a'
});
like image 138
Pedram Vdl Avatar answered Sep 20 '22 23:09

Pedram Vdl


If you are using timelineDay view, I found out that this setting will change the time format:

slotLabelFormat:"HH:mm"
like image 37
Maksim Luzik Avatar answered Sep 17 '22 23:09

Maksim Luzik


You can use this:

axisFormat: 'h:mm a'
like image 26
Mrudula Balachander Avatar answered Sep 16 '22 23:09

Mrudula Balachander