This commit is contained in:
stuzer05 2023-02-24 19:29:51 +02:00
parent 1cff1a9e05
commit e15549501d
1 changed files with 5 additions and 6 deletions

View File

@ -2479,10 +2479,10 @@ func (issue *Issue) TimeEstimateFromStr(timeStr string) int64 {
timeTotal := 0
// Time match regex
rWeeks, _ := regexp.Compile("([\\d]+)w")
rDays, _ := regexp.Compile("([\\d]+)d")
rHours, _ := regexp.Compile("([\\d]+)h")
rMinutes, _ := regexp.Compile("([\\d]+)m")
rWeeks := regexp.MustCompile(`([\d]+)w`)
rDays := regexp.MustCompile(`([\d]+)d`)
rHours := regexp.MustCompile(`([\d]+)h`)
rMinutes := regexp.MustCompile(`([\d]+)m`)
// Find time weeks
timeStrMatches := rWeeks.FindStringSubmatch(timeStr)
@ -2547,7 +2547,6 @@ func (issue *Issue) TimeEstimateToStr() string {
if minutes > 0 {
timeParts = append(timeParts, fmt.Sprintf("%dm", int64(minutes)))
}
timeSeconds -= minutes * (60)
return strings.Join(timeParts[:], " ")
return strings.Join(timeParts, " ")
}