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

Method Time

coderd/schedule/cron/cron.go:244–254  ·  view source on GitHub ↗

Time returns a humanized form of the minute and hour fields.

()

Source from the content-addressed store, hash-verified

242
243// Time returns a humanized form of the minute and hour fields.
244func (s Schedule) Time() string {
245 minute := strings.Fields(s.cronStr)[0]
246 hour := strings.Fields(s.cronStr)[1]
247 maybeTime := fmt.Sprintf("%s:%s", hour, minute)
248 t, err := time.ParseInLocation("15:4", maybeTime, s.sched.Location)
249 if err != nil {
250 // return the original cronspec for minute and hour, who knows what's in there!
251 return fmt.Sprintf("cron(%s %s)", minute, hour)
252 }
253 return t.Format(time.Kitchen)
254}
255
256// DaysOfWeek returns a humanized form of the day-of-week field.
257func (s Schedule) DaysOfWeek() string {

Callers 12

HumanizeMethod · 0.95
putWorkspaceDormantMethod · 0.45
postConvertLoginTypeMethod · 0.45
runOnceMethod · 0.45
ResolveRequestFunction · 0.45
Test_ResolveRequestFunction · 0.45
RefreshTokenMethod · 0.45
Test_WeeklyFunction · 0.45
secretListRowFromSecretFunction · 0.45
populateValueFunction · 0.45
parseScheduleMethod · 0.45
SetMethod · 0.45

Calls 2

FieldsMethod · 0.65
FormatMethod · 0.65

Tested by 2

Test_ResolveRequestFunction · 0.36
Test_WeeklyFunction · 0.36