From 3f1c8bf5c28a8cbff50b56367954d5daf4ad0bcc Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 21 Feb 2025 09:14:01 -0600 Subject: [PATCH] used for forge protobuf tables --- gitTag.byAge.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gitTag.byAge.go b/gitTag.byAge.go index f5e3188..6c4a852 100644 --- a/gitTag.byAge.go +++ b/gitTag.byAge.go @@ -87,6 +87,25 @@ func (repo *Repo) NewestAge() time.Duration { return time.Since(newest) } +func (repo *Repo) NewestTime() time.Time { + alltags := repo.Tags.selectAllGitTags() + + var newest time.Time + + for _, tag := range alltags { + // check the actual age of the patch + if newest.Before(tag.Authordate.AsTime()) { + newest = tag.Authordate.AsTime() + } + // check the age of the commit + if newest.Before(tag.Creatordate.AsTime()) { + newest = tag.Creatordate.AsTime() + } + } + + return newest +} + func (repo *Repo) NewestAgeVerbose() time.Duration { alltags := repo.Tags.selectAllGitTags()