Skip to content

Commit

Permalink
fix #62
Browse files Browse the repository at this point in the history
  • Loading branch information
timqian committed Oct 22, 2019
1 parent d6fced7 commit 56e7ed1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/getStarHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,9 @@ async function getStarHistory(repo, token) {
// Better view for less star repos (#28) and for repos with too much stars (>40000)
const resForStarNum = await axiosGit.get(`https://api.github.com/repos/${repo}`);
const starNumToday = resForStarNum.data.stargazers_count;
const today = new Date()
const monthFormat = today.getMonth() + 1 > 10 ? today.getMonth() + 1 : `0${today.getMonth() + 1}`
const dateFormat = today.getDate() > 10 ? today.getDate() : `0${today.getDate()}`

const today = new Date().toISOString().slice(0, 10);
starHistory.push({
date: `${today.getFullYear()}-${monthFormat}-${dateFormat}`,
date: today,
starNum: starNumToday
})

Expand Down

0 comments on commit 56e7ed1

Please sign in to comment.