Skip to content

Commit

Permalink
Merge pull request #17 from omnia-digital/dev
Browse files Browse the repository at this point in the history
- fix id and getId() errors depending on which version of livewire yo…
  • Loading branch information
joshtorres authored Feb 7, 2024
2 parents 04da6a7 + 9a709e9 commit b5fa515
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/LivewireCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,18 @@ public function onEventDropped($eventId, $year, $month, $day)
//
}

public function getId()
{
if (!empty($this->__id)) {
$id = $this->__id;
} else if (!empty($this->id)) {
$id = $this->id;
} else {
$id = 'livewire-calendar-' . uniqid();
}
return $id;
}

/**
* @return Factory|View
* @throws Exception
Expand All @@ -236,7 +248,7 @@ public function render()

return view($this->calendarView)
->with([
'componentId' => $this->id,
'componentId' => $this->getId(),
'monthGrid' => $this->monthGrid(),
'events' => $events,
'getEventsForDay' => function ($day) use ($events) {
Expand Down

0 comments on commit b5fa515

Please sign in to comment.