mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 01:54:06 +00:00
fix new Date() returns invalid date on safari, thus causing the contribution not able to display
This commit is contained in:
@@ -11,7 +11,7 @@ let contributions;
|
|||||||
contributions = JSON.parse(dom.getAttribute('data'));
|
contributions = JSON.parse(dom.getAttribute('data'));
|
||||||
let year = 0;
|
let year = 0;
|
||||||
for (const item of contributions) {
|
for (const item of contributions) {
|
||||||
item.publishDate = decodeURI(item.publishDate);
|
item.publishDate = decodeURI(item.publishDate).replace(' ','T');
|
||||||
item.date = new Date(item.publishDate);
|
item.date = new Date(item.publishDate);
|
||||||
if (item.date.getFullYear() > year) {
|
if (item.date.getFullYear() > year) {
|
||||||
year = item.date.getFullYear();
|
year = item.date.getFullYear();
|
||||||
|
Reference in New Issue
Block a user