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

Function nextDayMidnight

coderd/schedule/autostop.go:285–291  ·  view source on GitHub ↗

nextDayMidnight returns the next midnight in the time object's timezone.

(t time.Time)

Source from the content-addressed store, hash-verified

283
284// nextDayMidnight returns the next midnight in the time object's timezone.
285func nextDayMidnight(t time.Time) time.Time {
286 yy, mm, dd := t.Date()
287 // time.Date will correctly normalize the date if it's past the end of the
288 // month. E.g. October 32nd will be November 1st.
289 dd++
290 return time.Date(yy, mm, dd, 0, 0, 0, 0, t.Location())
291}
292
293// WeeksSinceEpoch gets the weeks since the epoch for a given time. This is a
294// 0-indexed number of weeks since the epoch (Monday).

Callers 1

CalculateAutostopFunction · 0.85

Calls 1

LocationMethod · 0.80

Tested by

no test coverage detected