瀏覽代碼

istat start date to today

FabioFratini 10 月之前
父節點
當前提交
222b4d516f
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      app/Http/Livewire/Istat.php

+ 7 - 1
app/Http/Livewire/Istat.php

@@ -166,7 +166,13 @@ class Istat extends Component
 
     public $title = 'ISTAT';
 
-    public $from = '2023-11-01', $to;
+    public $from, $to;
+
+    public function mount()
+    {
+        // Initialize $from with today's date in Y-m-d format
+        $this->from = now()->format('Y-m-d');
+    }
 
     protected $rules = [
         'from' => 'required',