Fix bug in date sorting due to dates being moved into the .metadata property of articles

This commit is contained in:
Tissevert 2019-02-19 12:20:28 +01:00
parent 11a1ab0f7b
commit 968b221efa

View file

@ -76,7 +76,8 @@ function Navigation(modules) {
function articleIds(tag, all) {
var ids = tag != undefined ? blog.tags[tag] : Object.keys(blog.articles);
ids.sort(function(idA, idB) {return blog.articles[idB].date - blog.articles[idA].date;});
var reverseDate = function (id) {return -blog.articles[id].metadata.date;};
ids.sort(modules.fun.compare(reverseDate));
return ids.slice(0, all ? undefined : blog.skin.previewArticlesCount);
}