MCPcopy Create free account
hub / github.com/github/gh-aw / parseBaseTime

Function parseBaseTime

pkg/parser/schedule_time_utils.go:123–136  ·  view source on GitHub ↗
(baseTime string)

Source from the content-addressed store, hash-verified

121}
122
123func parseBaseTime(baseTime string) (int, int, bool) {
124 switch baseTime {
125 case "midnight":
126 return 0, 0, true
127 case "noon":
128 return 0, 12, true
129 default:
130 lowerTime := strings.ToLower(baseTime)
131 if strings.HasSuffix(lowerTime, "am") || strings.HasSuffix(lowerTime, "pm") {
132 return parseAMPMTime(lowerTime)
133 }
134 return parse24HourTime(baseTime)
135 }
136}
137
138func parseAMPMTime(lowerTime string) (int, int, bool) {
139 isPM := strings.HasSuffix(lowerTime, "pm")

Callers 1

parseTimeFunction · 0.85

Calls 3

parseAMPMTimeFunction · 0.85
parse24HourTimeFunction · 0.85
ToLowerMethod · 0.80

Tested by

no test coverage detected