mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-17 14:52:57 +00:00
fix(static): fix blank post activity
This commit is contained in:
@@ -43,16 +43,18 @@ function switchYear(year) {
|
|||||||
for (const item of contributions) {
|
for (const item of contributions) {
|
||||||
if (item.date >= startDate && item.date <= endDate) {
|
if (item.date >= startDate && item.date <= endDate) {
|
||||||
posts.push(item);
|
posts.push(item);
|
||||||
if (!ms.includes(item.date.getMonth())) {
|
const time = item.date.getFullYear().toString() + "-" + item.date.getMonth().toString();
|
||||||
ms.push(item.date.getMonth());
|
if (!ms.includes(time)) {
|
||||||
|
ms.push(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
posts.sort((a, b) => { return b - a });
|
posts.sort((a, b) => { return b - a });
|
||||||
document.querySelector('#posts-activity').innerHTML = '';
|
document.querySelector('#posts-activity').innerHTML = '';
|
||||||
for (const month of ms) {
|
for (const time of ms) {
|
||||||
const node = document.createElement('div');
|
const node = document.createElement('div');
|
||||||
node.innerHTML = monthly(year, month, posts);
|
const array = time.split("-");
|
||||||
|
node.innerHTML = monthly(array[0], Number(array[1]), posts);
|
||||||
document.querySelector('#posts-activity').appendChild(node);
|
document.querySelector('#posts-activity').appendChild(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user