Ver Fonte

fixed dashboard date filter

= há 4 anos atrás
pai
commit
bb8709804d

+ 2 - 1
app/Http/Controllers/HomeController.php

@@ -305,7 +305,8 @@ class HomeController extends Controller
             $date = explode(" ", $appointment->start_time)[0];
             $appointment->milliseconds = strtotime($date) . '000';
             $appointment->newStatus = $appointment->status;
-            $appointment->dateYMD = date('Y-m-d', strtotime($appointment->start_time));
+
+            $appointment->dateYMD = date('Y-m-d', strtotime($appointment->raw_date));
             $appointment->clientName = $appointment->client->displayName();
             $appointment->clientInitials = substr($appointment->client->name_first, 0, 1) . substr($appointment->client->name_last, 0, 1);
             $appointment->proInitials = substr($appointment->pro->name_first, 0, 1) . substr($appointment->pro->name_last, 0, 1);

+ 1 - 1
resources/views/app/dashboard.blade.php

@@ -254,7 +254,7 @@
                     updateNumEventsForDate: function() {
                         this.numEventsForDate = 0;
                         for (let i = 0; i < this.events.length; i++) {
-                            if(this.events[i].raw_date === this.selectedDate &&
+                            if(this.events[i].dateYMD === this.selectedDate &&
                                 (this.filterStatus === '' || this.filterStatus === this.events[i].status)) {
                                 this.numEventsForDate++;
                             }