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