MCPcopy Index your code
hub / github.com/FloatTech/ZeroBot-Plugin / String

Method String

plugin/moyu/nowork.go:44–54  ·  view source on GitHub ↗

String 获取两个时间相差

()

Source from the content-addressed store, hash-verified

42
43// String 获取两个时间相差
44func (h *Holiday) String() string {
45 d := time.Until(h.date)
46 switch {
47 case d >= 0:
48 return "距离" + h.name + "还有: " + strconv.FormatFloat(d.Hours()/24.0, 'f', 2, 64) + "天!"
49 case d+h.dur >= 0:
50 return "好好享受 " + h.name + " 假期吧!"
51 default:
52 return "今年 " + h.name + " 假期已过"
53 }
54}
55
56func weekend() string {
57 t := time.Now().Weekday()

Callers 9

initFunction · 0.45
initFunction · 0.45
initFunction · 0.45
initFunction · 0.45
initFunction · 0.45
initFunction · 0.45
initFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected