Jump to content

Recommended Posts

Posted

I'm using the `$('#calendar').fullCalendar` function.

One calendar for notifications and another for rentals.

The notifications calendar looks as expected, but the rentals calendar doesn't; it only displays 30% horizontally. It needs to be stretched horizontally. The code is exactly the same, only the path is different.

I have absolutely no idea why. Does anyone have any advice?

 

 

err.png

std.png

Posted

That definitely looks like CSS is missing to get loaded on the first screenshot, how is it being loaded? Is this a 3rd party module?

Posted
 
  <?php
if ($page->path == "/avisierungen/kalender/" || $page->path == "/vermietungen/kalender/")
  {
  ?>
  <script>
    $(function(){
    'use strict'
 
    $('#calendar').fullCalendar({
      header: {
      left: 'prev,next today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay,listMonth'
      },
      height: 'auto',
      contentHeight: 'auto',
      aspectRatio: 2.0,
      weekNumbers: true,
      navLinks: true,
      eventTextColor: 'black',
      defaultDate: '<?php echo date("Y-m-d"); ?>',
      editable: false,
      eventLimit: true, // allow "more" link when too many events
      events: <?php echo json_encode($calendar_data); ?>
    });
    });
  <?php
  }
  ?>
Posted

@Frank Schneider Are you rendering this calendar on the front end or in the admin?

First thing I noticed was that the closing </script> tag is missing.

You can use the native PHP alternate control structure syntax if this is in a mixed markup/PHP file. It's up to your personal preference but it can help readability.

<?php if ($page->path == "/avisierungen/kalender/" || $page->path == "/vermietungen/kalender/"): ?>
  <script>
    $(function(){
      'use strict'
   
      $('#calendar').fullCalendar({
        header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay,listMonth'
        },
        height: 'auto',
        contentHeight: 'auto',
        aspectRatio: 2.0,
        weekNumbers: true,
        navLinks: true,
        eventTextColor: 'black',
        defaultDate: '<?=date("Y-m-d")?>',
        editable: false,
        eventLimit: true, // allow "more" link when too many events
        events: <?=json_encode($calendar_data)?>
      });
    }); 
  </script>
<?php endif ?>

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...