瀏覽代碼

:bug: adding by-date to accepted sort types

tags/1.0.0^2
J 3 年之前
父節點
當前提交
9d36906bde
共有 1 個文件被更改,包括 7 次插入12 次删除
  1. 7
    12
      vue-theme/src/utils/helpers.js

+ 7
- 12
vue-theme/src/utils/helpers.js 查看文件

@@ -3,24 +3,17 @@ const convertTitleCase = type => {
3 3
     return type.charAt(0).toUpperCase() + type.slice(1)
4 4
 }
5 5
 
6
-const materials = [
7
-    'clay',
8
-    'fiber',
9
-    'glass',
10
-    'metal',
11
-    'paper',
12
-    'wood'
13
-]
6
+const materials = ['clay', 'fiber', 'glass', 'metal', 'paper', 'wood']
14 7
 
15 8
 const sortTypes = {
16 9
     alpha: 'by-alpha',
17
-    recent: 'by-recent',
18
-    material: 'by-material',
10
+u    material: 'by-material',
19 11
     artist: 'by-artist',
20 12
     episode: 'by-episode',
21 13
     upcoming: 'by-upcoming',
22 14
     current: 'by-current',
23 15
     subtype: 'by-type',
16
+    date: 'by-date',
24 17
     currentAndUpcoming: 'by-current-and-upcoming',
25 18
     past: 'by-past',
26 19
 }
@@ -81,7 +74,9 @@ const ytThumbnail = (url, desiredSize) => {
81 74
 
82 75
 const formatDate = (unix, includeTime) => {
83 76
     const d = new Date(parseInt(unix) * 1000)
84
-    return includeTime ? d.toLocaleString('en-US', { timeZone: 'UTC' }) : d.toLocaleDateString('en-US', { timeZone: 'UTC' })
77
+    return includeTime
78
+        ? d.toLocaleString('en-US', { timeZone: 'UTC' })
79
+        : d.toLocaleDateString('en-US', { timeZone: 'UTC' })
85 80
 }
86 81
 
87 82
 export {
@@ -90,5 +85,5 @@ export {
90 85
     sortTypes,
91 86
     postTypes,
92 87
     ytThumbnail,
93
-    formatDate
88
+    formatDate,
94 89
 }

Loading…
取消
儲存