@@ -946,9 +946,13 @@ func (j *DSGit) EnrichItem(ctx *shared.Ctx, item map[string]interface{}) (rich m
946946 err = fmt .Errorf ("cannot parse author date from %v" , iAuthorDate )
947947 return
948948 }
949+
950+ authorLocation := time .FixedZone (fmt .Sprintf ("UTC%v" , authorTz ), int (authorTz )* 60 * 60 )
951+ authorLocalDate := time .Date (authorDate .Year (), authorDate .Month (), authorDate .Day (), authorDate .Hour (), authorDate .Minute (), authorDate .Second (), authorDate .Nanosecond (), authorLocation )
949952 rich ["orphaned" ] = false
950953 rich ["tz" ] = authorTz
951954 rich ["author_date" ] = authorDateTz
955+ rich ["author_local_date" ] = authorLocalDate .Format (time .RFC3339 )
952956 rich ["author_date_weekday" ] = int (authorDateTz .Weekday ())
953957 rich ["author_date_hour" ] = authorDateTz .Hour ()
954958 rich ["utc_author" ] = authorDate
@@ -961,8 +965,12 @@ func (j *DSGit) EnrichItem(ctx *shared.Ctx, item map[string]interface{}) (rich m
961965 err = fmt .Errorf ("cannot parse commit date from %v" , iAuthorDate )
962966 return
963967 }
968+
969+ committerLocation := time .FixedZone (fmt .Sprintf ("UTC%v" , commitTz ), int (commitTz )* 60 * 60 )
970+ committerLocationDate := time .Date (commitDate .Year (), commitDate .Month (), commitDate .Day (), commitDate .Hour (), commitDate .Minute (), commitDate .Second (), commitDate .Nanosecond (), committerLocation )
964971 rich ["commit_tz" ] = commitTz
965972 rich ["commit_date" ] = commitDateTz
973+ rich ["commit_local_date" ] = committerLocationDate .Format (time .RFC3339 )
966974 rich ["commit_date_weekday" ] = int (commitDateTz .Weekday ())
967975 rich ["commit_date_hour" ] = commitDateTz .Hour ()
968976 rich ["utc_commit" ] = commitDate
@@ -1243,6 +1251,7 @@ func (j *DSGit) GetModelData(ctx *shared.Ctx, docs []interface{}) []git.CommitCr
12431251 _ , commit .Orphaned = j .OrphanedMap [commit .SHA ]
12441252 commit .ParentSHAs , _ = doc ["parents" ].([]string )
12451253 commit .AuthoredTimestamp , _ = doc ["author_date" ].(time.Time )
1254+ commit .AuthoredLocalTimestamp , _ = doc ["author_local_date" ].(string )
12461255 authoredDt , _ := doc ["utc_author" ].(time.Time )
12471256 commit .RepositoryURL , _ = doc ["origin" ].(string )
12481257 commit .RepositoryID = repoID
@@ -1252,6 +1261,7 @@ func (j *DSGit) GetModelData(ctx *shared.Ctx, docs []interface{}) []git.CommitCr
12521261 }
12531262 commit .ID = commitID
12541263 commit .CommittedTimestamp , _ = doc ["commit_date" ].(time.Time )
1264+ commit .CommittedLocalTimestamp , _ = doc ["commit_local_date" ].(string )
12551265 createdOn := authoredDt
12561266 commit .SyncTimestamp = time .Now ()
12571267 commitRoles := []insights.Contributor {}
0 commit comments