~gitpocket/gitpocket

1

feat(web): join date on profiles

commit
a322579f2746c9860db2d17cfe070dc9152220f9 browse tree
parent
4f5d5816d0397b760e5e7bf4146dc9e0af42715d
author
obscurejames <354576047+obscurejames@users.noreply.github.com>
signature
Verified ~james signed with a key registered by ~james
date
2026-10-09 20:43 UTC

2 files changed, +5 −1

extra.go modified

@@ -488,7 +488,10 @@ type heatView struct {
488488 func (s *Server) activity(owner User, year int) heatView {
489489 counts := s.activityCounts(owner)
490490 today := time.Now().UTC().Truncate(24 * time.Hour)
491- years := map[int]bool{today.Year(): true}
491+ years := map[int]bool{}
492+ for y := min(owner.Created.UTC().Year(), today.Year()); y <= today.Year(); y++ {
493+ years[y] = true
494+ }
492495 for day := range counts {
493496 y, _ := strconv.Atoi(day[:4])
494497 years[y] = true

templates/user.html modified

@@ -12,6 +12,7 @@
1212 {{if $p.Location}}<p>{{$p.Location}}</p>{{end}}
1313 {{if $p.Workplace}}<p>{{$p.Workplace}}</p>{{end}}
1414 {{if $p.Website}}<p><a href="{{$p.Website}}" rel="nofollow me">{{$p.Website}}</a></p>{{end}}
15+<p class="muted small" title="{{date .Data.Owner.Created}}">Joined {{.Data.Owner.Created.Format "2 January 2006"}}</p>
1516 {{with .Data.Bio}}<div class="bio readme">{{.}}</div>{{end}}
1617 {{if $own}}<a class="btn primary block" href="/create">Create a new repository ▸</a><a class="btn block" href="/settings">Edit your profile ▸</a>{{end}}
1718 </aside>