noblemfd
1 month ago
405
1
Laravel

How to make Laravel FullCalendar not to scroll or display beyong the current year

Posted 1 month ago by noblemfd

I am using FullCalendar in my Laravel-5.8 application:

Controller

public function index()
{
    
    $leaverequests = HrLeaveRequest::all();
    return view('service.leave_requests.index')->with('leaverequests', $leaverequests);
}

view

  <div class="card-body">

    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css' />

    <div id='calendar'></div>
  </div>    

 <script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js'></script>
 <script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.js'></script>

<script>
  $(document).ready(function () {
        // page is now ready, initialize the calendar...

        $('#calendar').fullCalendar({
            // put your options and callbacks here

        })
    });
</script>

Diagram:

https://i.stack.imgur.com/MgHBP.png

What I want to achieve is that I don't want the Calendar to scroll beyond or below the current year. It should also only display the current year. The scrollbars should only allow the current year.

How do I achieve this?

Thank you

Please sign in or create an account to participate in this conversation.