mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
commit
af12ef61f5
2 changed files with 4 additions and 4 deletions
|
|
@ -49,7 +49,7 @@ export class Card {
|
||||||
trophyList.push(
|
trophyList.push(
|
||||||
new MultipleLangTrophy(userInfo.languageCount),
|
new MultipleLangTrophy(userInfo.languageCount),
|
||||||
new LongTimeAccountTrophy(userInfo.durationYear),
|
new LongTimeAccountTrophy(userInfo.durationYear),
|
||||||
new AncientAccountTrophy(userInfo.acientAccount),
|
new AncientAccountTrophy(userInfo.ancientAccount),
|
||||||
new Joined2020Trophy(userInfo.joined2020),
|
new Joined2020Trophy(userInfo.joined2020),
|
||||||
new AllSuperRankTrophy(isAllSRank),
|
new AllSuperRankTrophy(isAllSRank),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ export class UserInfo {
|
||||||
public totalRepositories: number,
|
public totalRepositories: number,
|
||||||
public languageCount: number,
|
public languageCount: number,
|
||||||
public durationYear: number,
|
public durationYear: number,
|
||||||
public acientAccount: number,
|
public ancientAccount: number,
|
||||||
public joined2020: number,
|
public joined2020: number,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ export class GithubAPIClient {
|
||||||
const durationTime = new Date().getTime() -
|
const durationTime = new Date().getTime() -
|
||||||
new Date(userData.createdAt).getTime();
|
new Date(userData.createdAt).getTime();
|
||||||
const durationYear = new Date(durationTime).getUTCFullYear() - 1970;
|
const durationYear = new Date(durationTime).getUTCFullYear() - 1970;
|
||||||
const acientAccount = new Date(userData.createdAt).getFullYear() <= 2010
|
const ancientAccount = new Date(userData.createdAt).getFullYear() <= 2010
|
||||||
? 1
|
? 1
|
||||||
: 0;
|
: 0;
|
||||||
const joined2020 = new Date(userData.createdAt).getFullYear() == 2020
|
const joined2020 = new Date(userData.createdAt).getFullYear() == 2020
|
||||||
|
|
@ -107,7 +107,7 @@ export class GithubAPIClient {
|
||||||
userData.repositories.totalCount,
|
userData.repositories.totalCount,
|
||||||
languages.size,
|
languages.size,
|
||||||
durationYear,
|
durationYear,
|
||||||
acientAccount,
|
ancientAccount,
|
||||||
joined2020
|
joined2020
|
||||||
);
|
);
|
||||||
return userInfo;
|
return userInfo;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue