Skip to content

Commit

Permalink
[FIX] split timezone (#120)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Takashi <nicolas.takashi@coralogix.com>
  • Loading branch information
nicolastakashi authored Jul 29, 2024
1 parent a4d765c commit bf7d6bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apis/coralogix/v1alpha1/alert_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,15 @@ func expandTimeFrames(scheduling *Scheduling) []*alerts.AlertActiveTimeframe {
}

func ExtractUTC(timeZone TimeZone) int32 {
utcStr := strings.Split(string(timeZone), "UTC")[1]
utc, _ := strconv.Atoi(utcStr)
parts := strings.Split(string(timeZone), "UTC")
if len(parts) < 2 {
return 0
}
utcStr := parts[1]
utc, err := strconv.Atoi(utcStr)
if err != nil {
return 0
}
return int32(utc)
}

Expand Down

0 comments on commit bf7d6bf

Please sign in to comment.