Fullcalendar show hour and minutes

Asked

Viewed 789 times

0

My fullcalendar is displaying the time of events, but for example: 08:00(When is **:00) and when is 08:30 it shows the time with minutes.

I wanted to let him show the hours and minutes even when it’s 8:00 not just when it’s 8:30

  • did not understand, you can explain better with excerpt of the code? Fullcalendar is that tool in JS ??

  • Describe more doubt, problem. Better post the code that controls the php view and the js code that interacts with the html document in the browser.

  • The problem is this, I do not know where is the part of the code that makes this visualization... downloaded from the site celke: https://celke.com.br/artigo/comoreditar-um-evento-fullcalendar-com-janela-modal-do-bootstrap

  • I’m not finding what you describe, how so 08:00(Quando é **:00) e quando é 08:30 ele mostra a hora com minutos.?

  • When it’s a straight time "8:00" it shows only 08, but when it’s time with a few minutes broken it shows whole "8:30 am".

3 answers

0

Add to your personalizado.css inside the briefcase /css the rewriting of the following css rule:

.fc-time-grid-event.fc-short .fc-time:before {
   content: attr(data-full);
}

This class defines the behavior of the element when there is an interval of less than 1 hour between start and end. Basically it assigns to the before element the value of the attribute data-full . The default setting for this element works in a logical way. But only by making this modification will you achieve the result.

0

I used the V4 and tested the two examples they put and it didn’t work, what solved for me was to touch directly the JS file "daygrid/main.min.js" and change the excerpt

of

n.prototype.computeEventTimeFormat=function(){
    return{
        hour:"numeric",
        minute:"2-digit",
        omitZeroMinute:!0,
        meridiem:"narrow"
    }
}

for

n.prototype.computeEventTimeFormat=function(){
    return{
        hour:"2-digit",
        minute:"2-digit",
        omitZeroMinute:0,
        meridiem:"narrow"
    }
}

The question is a little older but can help in the new versions, I found the answer in the stack English version.

Hugs.

0


Just add a timeFormat line to the calendar:

$('#calendario').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, defaultDate: '2016-01-12', editable: false, eventLimit: false, events: 'eventos.php',
eventColor: '#dd6777' **timeFormat: 'H(:mm)'** });

Browser other questions tagged

You are not signed in. Login or sign up in order to post.