diff --git a/README.md b/README.md index c21b8fa..c8b26e6 100755 --- a/README.md +++ b/README.md @@ -121,14 +121,26 @@ Example This will render a calendar grid. By default, the component will render the current month. If you want to change the -starting month, you can set the `year` and `month` props. +starting month, you can set the `initialYear` and `initialMonth` props. Example ```blade + ``` + +If you use it as a nested component, you can use variables and make it dynamic (:key prop will force livewire to re-render calendar). + +Example + + ```blade + ``` diff --git a/src/LivewireCalendar.php b/src/LivewireCalendar.php index 74c325b..2e84b4c 100755 --- a/src/LivewireCalendar.php +++ b/src/LivewireCalendar.php @@ -163,8 +163,8 @@ public function goToCurrentMonth() public function calculateGridStartsEnds() { - $this->gridStartsAt = $this->startsAt->clone()->startOfWeek($this->weekStartsAt); - $this->gridEndsAt = $this->endsAt->clone()->endOfWeek($this->weekEndsAt); + $this->gridStartsAt = $this->startsAt->clone()->startOfWeek($this->weekStartsAt)->shiftTimezone(config('app.timezone'));; + $this->gridEndsAt = $this->endsAt->clone()->endOfWeek($this->weekEndsAt)->shiftTimezone(config('app.timezone'));; } /**