MCPcopy Index your code
hub / github.com/coder/coder / parseTime

Function parseTime

cli/util.go:258–278  ·  view source on GitHub ↗

parseTime attempts to parse a time (no date) from the given string using a number of layouts.

(s string)

Source from the content-addressed store, hash-verified

256
257// parseTime attempts to parse a time (no date) from the given string using a number of layouts.
258func 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
280func formatActiveDevelopers(n int) string {
281 developerText := "developer"

Callers 1

parseCLIScheduleFunction · 0.85

Calls 1

ParseMethod · 0.65

Tested by

no test coverage detected