mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 18:14:06 +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) {
|
||||
if (item.date >= startDate && item.date <= endDate) {
|
||||
posts.push(item);
|
||||
if (!ms.includes(item.date.getMonth())) {
|
||||
ms.push(item.date.getMonth());
|
||||
const time = item.date.getFullYear().toString() + "-" + item.date.getMonth().toString();
|
||||
if (!ms.includes(time)) {
|
||||
ms.push(time);
|
||||
}
|
||||
}
|
||||
}
|
||||
posts.sort((a, b) => { return b - a });
|
||||
document.querySelector('#posts-activity').innerHTML = '';
|
||||
for (const month of ms) {
|
||||
for (const time of ms) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user