Full screen time format

Good afternoon, I know that this topic was discussed on the previous examples, however, despite the different topics, I still can not solve my problem. I use the full calendar at http://arshaw.com/fullcalendar/ , and they have two ways to display the time: "10: 30a" - "7p", for example. I want the time displayed in the calendar of events not to be full day, in the format "12:00 pm" or "12:00 am". The problem I am facing is that when you download the full calendar, 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 to suggest other threads, which is a change in fullcalendar.js in the time format and setdefault methods, but to no avail. I can even delete the file "fullcalendar.js" and my test still works fine. I want to know why this is so, and if the time format is not controlled where it is controlled? Thanks

+6
source share
7 answers

Use this and it will work:

$('#calendar').fullCalendar({ timeFormat: 'hh:mm a' }); 
+10
source

You can use this:

 axisFormat: 'h:mm a' 
+3
source

If you use the timelineDay view, I found that this parameter will change the time format:

 slotLabelFormat:"HH:mm" 
+3
source

At first I think you are confused with so many files, but basically you only need to use javascript and css thumbnails to make them work.

Secondly, I had the same problem with the correct time display. This is what I did, this is a bit of a workaround, but it worked for me, sorry if it's dirty.

When you initialize the calendar, you must put an option for timeformat so that it displays minutes, even if the clock is rounded.

 jQuery('#calendar').fullCalendar({ timeFormat: 'h:mm t' }); 

Then it only appeared “a” or “p” not “am” or “pm”, so I used some CSS magic to add “m” at the end, I created a rule:

 .fc-time:after { content: "m"; } 

now you can ruin the view of the week to add a rule

 .fc-axis.fc-time:after { content: " "; } 

And now, I hope you have it the way you want.

Hello

+2
source

in fullcalendar v3, they use moment.js to format time, you can format timeFormat: 'h: mm A', you can change between quotes by typing js docs in this page’s moment

+1
source

fullcalendar allows you to change the default time by setting the time format ( http://arshaw.com/fullcalendar/docs/text/timeFormat/ ). Probably better than changing the source code.

I think the reason your solution is not working is because you include fullcalendar.js and fullcalendar.min.js. These files contain the same code, the second is a miniature version of the first. Mini files are usually used in deployed versions of sites, while another version is used in development. Therefore, if you want to make changes, do not enable the mini version

0
source

In the scheduler.fullcalendar.js file, find the events: [], and under it add this line timeFormat: 'hh: mm A', it will show a time like 10:20 pm and if you want to show a time like this 10:20 Pm, use a little a

0
source

All Articles