Change grid height in week view

Home Forums Calendar Products Events Calendar PRO Change grid height in week view

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1118656
    Matthias
    Participant

    Hello there

    I was trying to change the grid height of the week view. Setting another value in CSS instead of the 60px does the trick at first. But then the events that are included via Javascript don’t have the right height, as the height is calculated with the help of the duration. Is there any way to change that anywhere?

    Thanks,
    Matthias

    #1118766
    Geoff B.
    Member

    Good evening Matthias and welcome to the Events Calendar Support forum!

    Thank you for reaching out to us.

    I would love to help you with this topic.

    To do a better job at answering, I would need a few screenshots and/or URLs to look at your specific situation.

    Also, as a first troubleshooting step, could you please provide us with your complete system information in a private reply using the instructions found in the following link?

    https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    With that in mind, if you had a higher hierarchy CSS rule (through specification), it should normally have priority, even with JavaScript at play. Here’s an example of what that would look like:

    .tribe-week-grid-wrapper .tribe-week-grid-block {
    height: 80px!important;
    }

    Best regards,

    Geoff B.

    #1119059
    Matthias
    Participant

    This reply is private.

    #1119061
    Matthias
    Participant

    Hey Geoff

    Thanks for your reply! I sent you a private reply with my system details as well. Attached is a screenshot of my calendar as well. As you can see, the problem is not the CSS settings. I have already overwritten the default styles and increased the height of the div-blocks.

    My problem is within the Javascripts. The height of the event is calculated with the help of the duration within the tribe-events-week.js:

    line 225: event_length = $this.attr( "data-duration" )

    As the duration of the event is 2 hours the length is 2x60min, so 120px. But as I set the div height of an hour to 100px in CSS, I would need to recalculate that Javascript value so it returns 200px. Is there kind of a best way to do that?

    Thanks,
    Matthias

    #1119066
    Matthias
    Participant

    Hey Geoff

    Writing the above reply made me digging into the code a bit deeper again. I solved my issue now by myself using the tribe_events_week_event_attributes filter that is used within the single-event.php.

    There I fetched the event attributes and recalculated the event duration. I hope it doesn’t bring me into any other trouble on any other parts of the site…

    Thanks,
    Matthias

    #1119409
    Geoff B.
    Member

    Hello Matthias,

    Wow! I’m super impressed on such excellent work!

    Thank you for sharing for everybody’s benefit!

    You are welcome back on our support forums any time 🙂

    For now, I am going to close this thread.

    Have a great week!

    Geoff B.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change grid height in week view’ is closed to new replies.