parseTime attempts to parse a time (no date) from the given string using a number of layouts.
(s string)
| 256 | |
| 257 | // parseTime attempts to parse a time (no date) from the given string using a number of layouts. |
| 258 | func parseTime(s string) (time.Time, error) { |
| 259 | // Try a number of possible layouts. |
| 260 | for _, layout := range []string{ |
| 261 | time.Kitchen, // 03:04PM |
| 262 | "03:04pm", |
| 263 | "3:04PM", |
| 264 | "3:04pm", |
| 265 | "15:04", |
| 266 | "1504", |
| 267 | "03PM", |
| 268 | "03pm", |
| 269 | "3PM", |
| 270 | "3pm", |
| 271 | } { |
| 272 | t, err := time.Parse(layout, s) |
| 273 | if err == nil { |
| 274 | return t, nil |
| 275 | } |
| 276 | } |
| 277 | return time.Time{}, errInvalidTimeFormat |
| 278 | } |
| 279 | |
| 280 | func formatActiveDevelopers(n int) string { |
| 281 | developerText := "developer" |
no test coverage detected