Monorepo for Tangled tangled.org

appview: profile: fix panic in timeline generation

off by one

authored by oppi.li and committed by Tangled f5f430be 8d7373fa

Changed files
+4 -4
appview
+4 -4
appview/db/profile.go
··· 81 81 Merged int 82 82 } 83 83 84 - const TimeframeMonths = 3 84 + const TimeframeMonths = 7 85 85 86 86 func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) { 87 87 timeline := ProfileTimeline{ ··· 99 99 for _, pull := range pulls { 100 100 pullMonth := pull.Created.Month() 101 101 102 - if currentMonth-pullMonth > TimeframeMonths { 102 + if currentMonth-pullMonth >= TimeframeMonths { 103 103 // shouldn't happen; but times are weird 104 104 continue 105 105 } ··· 118 118 for _, issue := range issues { 119 119 issueMonth := issue.Created.Month() 120 120 121 - if currentMonth-issueMonth > TimeframeMonths { 121 + if currentMonth-issueMonth >= TimeframeMonths { 122 122 // shouldn't happen; but times are weird 123 123 continue 124 124 } ··· 146 146 147 147 repoMonth := repo.Created.Month() 148 148 149 - if currentMonth-repoMonth > TimeframeMonths { 149 + if currentMonth-repoMonth >= TimeframeMonths { 150 150 // shouldn't happen; but times are weird 151 151 continue 152 152 }