|
@@ -34,8 +34,13 @@ func NewEventSemeTimeFlow(semeTimeId int64, req *pasturePb.SemeTimeRequest) *Eve
|
|
|
if i != len(req.Graph.Nodes)-1 && i < len(req.Graph.Edges) {
|
|
|
edgesTextValue := req.Graph.Edges[i].Text.Value
|
|
|
dayHours := strings.Split(edgesTextValue, "/")
|
|
|
- dayStr := regexp.MustCompile(`\d+`).FindString(dayHours[0])
|
|
|
- hoursStr := regexp.MustCompile(`\d+`).FindString(dayHours[1])
|
|
|
+ dayStr, hoursStr := "0", "0"
|
|
|
+ if len(dayHours) > 0 && len(dayHours) == 1 {
|
|
|
+ dayStr = regexp.MustCompile(`\d+`).FindString(dayHours[0])
|
|
|
+ }
|
|
|
+ if len(dayHours) > 0 && len(dayHours) == 2 {
|
|
|
+ hoursStr = regexp.MustCompile(`\d+`).FindString(dayHours[1])
|
|
|
+ }
|
|
|
day, _ := strconv.Atoi(dayStr)
|
|
|
hours, _ := strconv.Atoi(hoursStr)
|
|
|
conditions.Day = int32(day)
|