Kaynağa Gözat

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

tags/0.9.0
J 4 yıl önce
ebeveyn
işleme
930736203a

+ 4
- 3
vue-theme/src/components/card.vue Dosyayı Görüntüle

13
         .f-col.w-max
13
         .f-col.w-max
14
             router-link(:to="`/${type}/${content.slug}`")
14
             router-link(:to="`/${type}/${content.slug}`")
15
                 h1.t-up.t-cntr.t-b {{ content.title }}
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
             p {{ content.excerpt }}
18
             p {{ content.excerpt }}
18
 </template>
19
 </template>
19
 
20
 
24
     props: ['type', 'content', 'wide', 'hide-type'],
25
     props: ['type', 'content', 'wide', 'hide-type'],
25
     methods: {
26
     methods: {
26
         dateFrom(unix, includeTime) {
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 Dosyayı Görüntüle

177
          * Date Object from unix strings from db
177
          * Date Object from unix strings from db
178
          */
178
          */
179
         dateFrom(unix, includeTime) {
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
         async loadPostData() {
184
         async loadPostData() {

Loading…
İptal
Kaydet