Home > Back-end >  Livewire Calendar: How to add Next Month and Previous Month
Livewire Calendar: How to add Next Month and Previous Month

Time:06-10

In our application, we have activities module. I implemented the livewire calendar in our application but having a hard time displaying the next & previous month

I used the cdn of tailwindcss.

Dashboard View

<div>
<!-- <livewire:appointments-calendar/> -->
<livewire:appointments-grid
    week-starts-at="0"
    before-calendar-view="livewire/members-portal\members-dashboard\before-month"

/>

Before Month View File

<h2 >{{ $this->startsAt->format('M Y') }} </h2>

Controller

<?php

namespace App\Http\Livewire\MembersPortal\MembersDashboard;

use Livewire\Component;
use Asantibanez\LivewireCalendar\LivewireCalendar;
use Illuminate\Support\Collection;
use Carbon\Carbon;

class MembersDashboard extends LivewireCalendar
{
    public function events() : Collection
    {
        // must return a Laravel collection
        return collect([
                [
                    'id' => 1,
                    'title' => 'Breakfast',
                    'description' => 'Pancakes!            
  • Related