forked from tangled.org/core
this repo has no description

appview: profile: fix panic in timeline generation

off by one

Changed files
+4 -4
appview
+4 -4
appview/db/profile.go
···
Merged int
}
-
const TimeframeMonths = 3
+
const TimeframeMonths = 7
func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) {
timeline := ProfileTimeline{
···
for _, pull := range pulls {
pullMonth := pull.Created.Month()
-
if currentMonth-pullMonth > TimeframeMonths {
+
if currentMonth-pullMonth >= TimeframeMonths {
// shouldn't happen; but times are weird
continue
}
···
for _, issue := range issues {
issueMonth := issue.Created.Month()
-
if currentMonth-issueMonth > TimeframeMonths {
+
if currentMonth-issueMonth >= TimeframeMonths {
// shouldn't happen; but times are weird
continue
}
···
repoMonth := repo.Created.Month()
-
if currentMonth-repoMonth > TimeframeMonths {
+
if currentMonth-repoMonth >= TimeframeMonths {
// shouldn't happen; but times are weird
continue
}