Przeglądaj źródła

:bug: fixed undefined func for events and exhibitions | #115

tags/0.9.0
J 4 lat temu
rodzic
commit
930736203a

+ 4
- 3
vue-theme/src/components/card.vue Wyświetl plik

@@ -13,7 +13,8 @@
13 13
         .f-col.w-max
14 14
             router-link(:to="`/${type}/${content.slug}`")
15 15
                 h1.t-up.t-cntr.t-b {{ content.title }}
16
-            p(v-if="content.end") {{ dateFrom(content.start) }} – {{ dateFrom(content.end) }}
16
+            p(v-if="content.end && type == 'event'") {{ dateFrom(content.start, type=='event') }} – {{ dateFrom(content.end, type=='event').split(',')[1] }}
17
+            p(v-else-if="content.end") {{ dateFrom(content.start, type=='event') }} – {{ dateFrom(content.end, type=='event') }}
17 18
             p {{ content.excerpt }}
18 19
 </template>
19 20
 
@@ -24,8 +25,8 @@ export default {
24 25
     props: ['type', 'content', 'wide', 'hide-type'],
25 26
     methods: {
26 27
         dateFrom(unix, includeTime) {
27
-            const f = includeTime ? 'dd-m-yy h:MM' : 'dd-m-yy'
28
-            return new Date(parseInt(unix) * 1000).format(f)
28
+            const d = new Date(parseInt(unix) * 1000)
29
+            return includeTime ? d.toLocaleString('en-US') : d.toLocaleDateString('en-US')
29 30
         }
30 31
     }
31 32
 }

+ 2
- 2
vue-theme/src/pages/single.vue Wyświetl plik

@@ -177,8 +177,8 @@ export default {
177 177
          * Date Object from unix strings from db
178 178
          */
179 179
         dateFrom(unix, includeTime) {
180
-            const f = includeTime ? 'dd-m-yy h:MM' : 'dd-m-yy'
181
-            return new Date(parseInt(unix) * 1000).format(f)
180
+            const d = new Date(parseInt(unix) * 1000)
181
+            return includeTime ? d.toLocaleString('en-US') : d.toLocaleDateString('en-US')
182 182
         },
183 183
 
184 184
         async loadPostData() {

Ładowanie…
Anuluj
Zapisz