Selaa lähdekoodia

to be stashed

Peter Muturi 3 vuotta sitten
vanhempi
commit
7d458008f3

+ 10 - 5
resources/views/app/dashboard-mcp.blade.php

@@ -12,7 +12,6 @@
             vertical-align: middle;
         }
     </style>
-
     <div class="p-3">
         <div class="">
             <div class="row mcp-theme-1" id="pro-dashboard-container" v-cloak>
@@ -296,12 +295,12 @@
                             <div class="card mb-4">
                                 <div class="card-header pl-2">
                                     <strong>
-                                        Appointments @{{ selectedDate }}
+                                        Appointments @{{ formatDate(selectedDate) }}
                                     </strong>
                                 </div>
                                 <div class="card-body p-0">
 
-                                    <table class="table table-sm table-bordered appointments">
+                                    <table v-if="events.length > 0" class="table table-sm table-bordered appointments">
                                         <tr v-for="event in events" class="">
                                             <td>
                                                 <a :href="'/patients/view/' + event.clientUid" class="font-weight-bold">@{{
@@ -366,8 +365,8 @@
 
                                     <div v-if="numEventsForDate === 0"
                                          class="bg-light p-3 text-secondary border bounded">
-                                        <span v-if="filterStatus === ''">You have no appointments on <b>@{{ selectedDate }}</b></span>
-                                        <span v-if="filterStatus !== ''">You have no appointments on <b>@{{ selectedDate }}</b> with status <b>@{{ filterStatus }}</b></span>
+                                        <span v-if="filterStatus === ''">You have no appointments on <b>@{{ formatDate(selectedDate) }}</b></span>
+                                        <span v-if="filterStatus !== ''">You have no appointments on <b>@{{ formatDate(selectedDate) }}</b> with status <b>@{{ filterStatus }}</b></span>
                                     </div>
 
                                     <div v-show="!selectedDate" class="bg-light p-3 text-secondary border bounded">
@@ -1143,6 +1142,12 @@
                           day =  day < 10 ? '0' + day : day;
 
                           return date.getFullYear()+'-'+parseInt(date.getMonth()+1) +'-' + day;
+                        },
+                        formatDate: function(_date, _format) {
+                          _format = _format || 'MM/DD/YYYY';
+                          if(_date) {
+                            return moment(_date).format(_format);
+                          }
                         }
                     },
                     mounted: function () {

+ 2 - 0
resources/views/layouts/template.blade.php

@@ -72,6 +72,8 @@
             integrity="sha512-iKDtgDyTHjAitUDdLljGhenhPwrbBfqTKWO1mkhSFH3A7blITC9MhYon6SjnMhp4o0rADGw9yAC6EW4t5a4K3g=="
             crossorigin="anonymous"></script>
 
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
+
     @yield('head')
 </head>