feat: use active users instead of total users in Template views (#3900)

This commit is contained in:
Ammar Bandukwala
2022-09-09 19:30:31 +00:00
committed by GitHub
parent 346583f13e
commit f6aa025a01
20 changed files with 251 additions and 142 deletions
+17
View File
@@ -2,6 +2,7 @@ package cli
import (
"fmt"
"strconv"
"strings"
"time"
@@ -175,3 +176,19 @@ func parseTime(s string) (time.Time, error) {
}
return time.Time{}, errInvalidTimeFormat
}
func formatActiveDevelopers(n int) string {
developerText := "developer"
if n != 1 {
developerText = "developers"
}
var nStr string
if n < 0 {
nStr = "-"
} else {
nStr = strconv.Itoa(n)
}
return fmt.Sprintf("%s active %s", nStr, developerText)
}