Andrew Wallo 3 місяці тому
джерело
коміт
0f31bce43b

+ 2
- 2
app/Filament/Company/Resources/Purchases/BillResource.php Переглянути файл

@@ -96,8 +96,8 @@ class BillResource extends Resource
96 96
                                         })
97 97
                                         ->columnSpan(2)
98 98
                                         ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) {
99
-                                            $date = $state;
100
-                                            $dueDate = $get('due_date');
99
+                                            $date = Carbon::parse($state)->toDateString();
100
+                                            $dueDate = Carbon::parse($get('due_date'))->toDateString();
101 101
 
102 102
                                             if ($date && $dueDate && $date > $dueDate) {
103 103
                                                 $set('due_date', $date);

+ 3
- 3
app/Filament/Company/Resources/Sales/EstimateResource.php Переглянути файл

@@ -96,8 +96,8 @@ class EstimateResource extends Resource
96 96
                                         ->timezone(CompanySettingsService::getDefaultTimezone())
97 97
                                         ->columnSpan(2)
98 98
                                         ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) {
99
-                                            $date = $state;
100
-                                            $expirationDate = $get('expiration_date');
99
+                                            $date = Carbon::parse($state)->toDateString();
100
+                                            $expirationDate = Carbon::parse($get('expiration_date'))->toDateString();
101 101
 
102 102
                                             if ($date && $expirationDate && $date > $expirationDate) {
103 103
                                                 $set('expiration_date', $date);
@@ -143,7 +143,7 @@ class EstimateResource extends Resource
143 143
                                     })
144 144
                                     ->timezone(CompanySettingsService::getDefaultTimezone())
145 145
                                     ->minDate(static function (Forms\Get $get) {
146
-                                        return $get('date') ?? now();
146
+                                        return Carbon::parse($get('date'))->toDateString() ?? now(CompanySettingsService::getDefaultTimezone())->toDateString();
147 147
                                     })
148 148
                                     ->live()
149 149
                                     ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) {

+ 3
- 3
app/Filament/Company/Resources/Sales/InvoiceResource.php Переглянути файл

@@ -103,8 +103,8 @@ class InvoiceResource extends Resource
103 103
                                         })
104 104
                                         ->columnSpan(2)
105 105
                                         ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) {
106
-                                            $date = $state;
107
-                                            $dueDate = $get('due_date');
106
+                                            $date = Carbon::parse($state)->toDateString();
107
+                                            $dueDate = Carbon::parse($get('due_date'))->toDateString();
108 108
 
109 109
                                             if ($date && $dueDate && $date > $dueDate) {
110 110
                                                 $set('due_date', $date);
@@ -151,7 +151,7 @@ class InvoiceResource extends Resource
151 151
                                     })
152 152
                                     ->timezone(CompanySettingsService::getDefaultTimezone())
153 153
                                     ->minDate(static function (Forms\Get $get) {
154
-                                        return $get('date') ?? now();
154
+                                        return Carbon::parse($get('date'))->toDateString() ?? now(CompanySettingsService::getDefaultTimezone())->toDateString();
155 155
                                     })
156 156
                                     ->live()
157 157
                                     ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) {

Завантаження…
Відмінити
Зберегти