|
|
@@ -41,15 +41,17 @@ func GetCycle(eg *xorm.Engine) map[string]string { |
|
|
|
} |
|
|
|
last := postion - 1 |
|
|
|
next := postion |
|
|
|
types := "now" |
|
|
|
if postion-1 < 0 { //找出上一周期的时间 |
|
|
|
last = len(ex) - 1 |
|
|
|
} else if last == len(ex)-1 { //最后一个了 |
|
|
|
next = 0 |
|
|
|
types = "next" |
|
|
|
} |
|
|
|
|
|
|
|
lastDate := GetDate(now, ex[last], "last") |
|
|
|
res["last"] = time.Unix(lastDate, 0).Format("20060102") |
|
|
|
nowDate := GetDate(now, ex[next], "now") |
|
|
|
nowDate := GetDate(now, ex[next], types) |
|
|
|
res["now"] = time.Unix(nowDate, 0).Format("20060102") |
|
|
|
} |
|
|
|
} |
|
|
|