Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join date is incorrect #738

Closed
lowlighter opened this issue Jan 2, 2022 Discussed in #737 · 1 comment · Fixed by #746
Closed

Join date is incorrect #738

lowlighter opened this issue Jan 2, 2022 Discussed in #737 · 1 comment · Fixed by #746

Comments

@lowlighter
Copy link
Owner

Discussed in #737

Originally posted by JBYT27 January 2, 2022

Hello!

So I checked out my metrics.svg, but for some reason it says I joined 1 day ago, which isn't true. When you check the contributions on my profile page, it says otherwise, and I have been on GitHub for at least almost a year. Is it possible to fix this? Thanks!

Screenshots

Metrics

Screenshot 2022-01-02 11 19 08 AM

GitHub contributions

Screenshot 2022-01-02 11 19 52 AM


Should be an issue within this code section:

//Compute registration date
const now = Date.now()
const beginningOfYear = new Date(now).setUTCMonth(0, 1)
const created = new Date(data.user.createdAt)
const diff = now - created
const years = new Date(diff).getUTCFullYear() - new Date(0).getUTCFullYear()
const nowMonth = new Date(now).getUTCMonth()
const createdMonth = created.getUTCMonth()
const months = nowMonth - createdMonth + 12 * (years + (nowMonth < createdMonth ? 1 : 0))
const days = Math.floor((now - beginningOfYear) / (1000 * 60 * 60 * 24))
computed.registered = {years: years + days / 365.25, months}
computed.registration = years ? `${years} year${imports.s(years)} ago` : months ? `${months} month${imports.s(months)} ago` : `${days} day${imports.s(days)} ago`
computed.cakeday = years > 1 ? [new Date(), new Date(data.user.createdAt)].map(date => date.toISOString().match(/(?<mmdd>\d{2}-\d{2})(?=T)/)?.groups?.mmdd).every((v, _, a) => v === a[0]) : false

@lowlighter lowlighter changed the title [ISSUE] Wrong join date Join date is incorrect Jan 2, 2022
@lowlighter
Copy link
Owner Author

image

JayantGoel001 added a commit to JayantGoel001/metrics that referenced this issue Jan 7, 2022
@lowlighter lowlighter linked a pull request Jan 7, 2022 that will close this issue
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant