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

Function splitBaseTimeAndUTCOffset

pkg/parser/schedule_time_utils.go:112–121  ·  view source on GitHub ↗
(timeStr string)

Source from the content-addressed store, hash-verified

110}
111
112func splitBaseTimeAndUTCOffset(timeStr string) (string, int) {
113 parts := strings.Split(timeStr, " ")
114 if len(parts) == 2 && strings.HasPrefix(strings.ToLower(parts[1]), "utc") {
115 return parts[0], parseUTCOffset(strings.ToLower(parts[1]))
116 }
117 if len(parts) == 3 && isAMPMToken(parts[1]) && strings.HasPrefix(strings.ToLower(parts[2]), "utc") {
118 return parts[0] + " " + parts[1], parseUTCOffset(strings.ToLower(parts[2]))
119 }
120 return timeStr, 0
121}
122
123func parseBaseTime(baseTime string) (int, int, bool) {
124 switch baseTime {

Callers 1

parseTimeFunction · 0.85

Calls 3

parseUTCOffsetFunction · 0.85
isAMPMTokenFunction · 0.85
ToLowerMethod · 0.80

Tested by

no test coverage detected