Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week view #42

Open
rabol opened this issue Oct 13, 2022 · 2 comments
Open

Week view #42

rabol opened this issue Oct 13, 2022 · 2 comments

Comments

@rabol
Copy link

rabol commented Oct 13, 2022

Hi

how can I get 'week' view

@killawabbit
Copy link

+1 on this one
And also if it could be only weekdays without weekends

@lrljoe
Copy link

lrljoe commented Nov 14, 2022

+1 on this one And also if it could be only weekdays without weekends

As an interim fix, you can edit the calendar blade file to skip Saturday/Sunday.

E.g.

  <div class="flex flex-row w-full">
      @foreach ($monthGrid->first() as $day)
          @if ($day->dayOfWeek != 0 && $day->dayOfWeek != 6)
              @include($dayOfWeekView, ['day' => $day])
          @endif
      @endforeach
  </div>

Remembering to also do the same for the monthGrid, e.g.

@foreach ($monthGrid as $week)
    <div class="flex flex-row w-full dark:bg-dark" :wire:key="$loop->index">
        @foreach ($week as $day)
        @if ($day->dayOfWeek != 0 && $day->dayOfWeek != 6)
                @include($dayView, [
                    'componentId' => Str::random(40),
                    'day' => $day,
                    'dayInMonth' => $day->isSameMonth($startsAt),
                    'isToday' => $day->isToday(),
                    'events' => $getEventsForDay($day, $events),
                ])
            @endif
        @endforeach
    </div>
@endforeach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants