|
|
@@ -38,6 +38,8 @@ class Calendar extends Component
|
|
|
public $festivities = [];
|
|
|
public $css_festivities = '';
|
|
|
|
|
|
+ public $lastDate = null;
|
|
|
+
|
|
|
public function mount()
|
|
|
{
|
|
|
$this->names = \App\Models\Calendar::orderBy('name')->groupBy('name')->pluck('name')->toArray();
|
|
|
@@ -115,8 +117,24 @@ class Calendar extends Component
|
|
|
}, $this->festivities);
|
|
|
$this->css_festivities = implode(", ", $this->festivities);
|
|
|
|
|
|
+ $this->lastDate = null;
|
|
|
+ if (isset($_GET['last_date'])) {
|
|
|
+ try {
|
|
|
+ $this->lastDate = \Illuminate\Support\Facades\Date::createFromFormat('Y-m-d', $_GET['last_date']);
|
|
|
+ } catch (\Throwable $e) {
|
|
|
+ $this->lastDate = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!$this->lastDate) {
|
|
|
+ $this->lastDate = null;
|
|
|
+ } else {
|
|
|
+ $this->lastDate = $this->lastDate->format("Y-m-d");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ($reload)
|
|
|
$this->emit('reload-calendar', ["'" . json_encode($this->records) . "'"]);
|
|
|
+
|
|
|
return view('livewire.calendar');
|
|
|
}
|
|
|
|