mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
优化RangeDesc
This commit is contained in:
@@ -113,7 +113,7 @@ func (this *Workday) TodayIs() bool {
|
|||||||
// RangeDesc 倒序遍历工作日,从今天-1990年12月19日(上海交易所成立时间)
|
// RangeDesc 倒序遍历工作日,从今天-1990年12月19日(上海交易所成立时间)
|
||||||
func (this *Workday) RangeDesc(f func(t time.Time) bool) {
|
func (this *Workday) RangeDesc(f func(t time.Time) bool) {
|
||||||
t := IntegerDay(time.Now())
|
t := IntegerDay(time.Now())
|
||||||
for ; t.Before(time.Date(1990, 12, 1, 0, 0, 0, 0, time.Local)); t = t.Add(-time.Hour * 24) {
|
for ; t.After(time.Date(1990, 12, 18, 0, 0, 0, 0, time.Local)); t = t.Add(-time.Hour * 24) {
|
||||||
if this.Is(t) {
|
if this.Is(t) {
|
||||||
if !f(t) {
|
if !f(t) {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user