Browse Source

:bug: adding by-date to accepted sort types

tags/1.0.0^2
J 3 years ago
parent
commit
9d36906bde
1 changed files with 7 additions and 12 deletions
  1. 7
    12
      vue-theme/src/utils/helpers.js

+ 7
- 12
vue-theme/src/utils/helpers.js View File

3
     return type.charAt(0).toUpperCase() + type.slice(1)
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
 const sortTypes = {
8
 const sortTypes = {
16
     alpha: 'by-alpha',
9
     alpha: 'by-alpha',
17
-    recent: 'by-recent',
18
-    material: 'by-material',
10
+u    material: 'by-material',
19
     artist: 'by-artist',
11
     artist: 'by-artist',
20
     episode: 'by-episode',
12
     episode: 'by-episode',
21
     upcoming: 'by-upcoming',
13
     upcoming: 'by-upcoming',
22
     current: 'by-current',
14
     current: 'by-current',
23
     subtype: 'by-type',
15
     subtype: 'by-type',
16
+    date: 'by-date',
24
     currentAndUpcoming: 'by-current-and-upcoming',
17
     currentAndUpcoming: 'by-current-and-upcoming',
25
     past: 'by-past',
18
     past: 'by-past',
26
 }
19
 }
81
 
74
 
82
 const formatDate = (unix, includeTime) => {
75
 const formatDate = (unix, includeTime) => {
83
     const d = new Date(parseInt(unix) * 1000)
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
 export {
82
 export {
90
     sortTypes,
85
     sortTypes,
91
     postTypes,
86
     postTypes,
92
     ytThumbnail,
87
     ytThumbnail,
93
-    formatDate
88
+    formatDate,
94
 }
89
 }

Loading…
Cancel
Save