Skip to content

Commit

Permalink
fix: correctly parse date with negative timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
Tchoupinax committed Mar 16, 2022
1 parent 604a3f2 commit edf0db5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ func (b *Branch) GetCommitterDateFromLogs() {

for index, match := range re.FindAllString(string(stdout), -1) {
if index == 0 {
var a = strings.Split(match, " +")[0]
a := strings.Split(match, " +")[0]

if strings.Contains(a, " -") {
a = strings.Split(match, " -")[0]
}

var c = strings.Split(a, "Date: ")

t, err := time.Parse(time.ANSIC, c[1])

if err != nil {
Expand Down

0 comments on commit edf0db5

Please sign in to comment.