Просмотр исходного кода

added timezone UTC adjustment

tags/0.9.0
Alej 4 лет назад
Родитель
Сommit
c3d194c77c
2 измененных файлов: 2 добавлений и 2 удалений
  1. 1
    1
      vue-theme/src/components/card.vue
  2. 1
    1
      vue-theme/src/pages/single.vue

+ 1
- 1
vue-theme/src/components/card.vue Просмотреть файл

@@ -27,7 +27,7 @@ export default {
27 27
     methods: {
28 28
         dateFrom(unix, includeTime) {
29 29
             const d = new Date(parseInt(unix) * 1000)
30
-            return includeTime ? d.toLocaleString('en-US') : d.toLocaleDateString('en-US')
30
+            return includeTime ? d.toLocaleString('en-US', { timeZone: 'UTC' }) : d.toLocaleDateString('en-US')
31 31
         }
32 32
     }
33 33
 }

+ 1
- 1
vue-theme/src/pages/single.vue Просмотреть файл

@@ -178,7 +178,7 @@ export default {
178 178
          */
179 179
         dateFrom(unix, includeTime) {
180 180
             const d = new Date(parseInt(unix) * 1000)
181
-            return includeTime ? d.toLocaleString('en-US') : d.toLocaleDateString('en-US')
181
+            return includeTime ? d.toLocaleString('en-US', { timeZone: 'UTC' }) : d.toLocaleDateString('en-US')
182 182
         },
183 183
 
184 184
         async loadPostData() {

Загрузка…
Отмена
Сохранить