mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 10:04:04 +00:00
fix
This commit is contained in:
10
README.md
10
README.md
@@ -1,15 +1,5 @@
|
|||||||
# github-style
|
# github-style
|
||||||
|
|
||||||
## 已知问题
|
|
||||||
|
|
||||||
- 往年热力图起始点错误
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
- 评论
|
|
||||||
- 自定义菜单
|
|
||||||
- 更多链接平台支持
|
|
||||||
|
|
||||||
## Init hugo site
|
## Init hugo site
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@@ -173,12 +173,13 @@ function graph(year, posts, startDate, endDate) {
|
|||||||
}
|
}
|
||||||
const monthPos = [];
|
const monthPos = [];
|
||||||
let startMonth = -1;
|
let startMonth = -1;
|
||||||
|
const weekday = startDate.getDay();
|
||||||
for (let i = 0; i < 53; i++) {
|
for (let i = 0; i < 53; i++) {
|
||||||
html += `<g transform="translate(${i * 16}, 0)">`;
|
html += `<g transform="translate(${i * 16}, 0)">`;
|
||||||
for (let j = 0; j < 7; j++) {
|
for (let j = 0; j < 7; j++) {
|
||||||
const date = new Date(startDate.getTime() + (i * 7 + j) * 24 * 60 * 60 * 1000);
|
const date = new Date(startDate.getTime() + (i * 7 + j - weekday) * 24 * 60 * 60 * 1000);
|
||||||
const dataDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
const dataDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
|
||||||
if (date > endDate) {
|
if (date < startDate || date > endDate) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user