We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b80879 commit 2842d44Copy full SHA for 2842d44
generate/component/article/helper-sort.js
@@ -20,5 +20,9 @@ export function helperSort(data) {
20
*/
21
function score(d) {
22
const matter = d.data.matter || {}
23
- return matter.index || Number.POSITIVE_INFINITY
+ const published =
24
+ typeof matter.published === 'string'
25
+ ? new Date(matter.published)
26
+ : matter.published || undefined
27
+ return matter.index || published?.getTime() || Number.POSITIVE_INFINITY
28
}
0 commit comments