From acc2048908e6cc882d3a37a7450cc3dc533f6c0a Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Fri, 19 Nov 2021 11:52:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8C=89=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=B7=AE8=E5=B0=8F=E6=97=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/api/v1/repo/repo_dashbord.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routers/api/v1/repo/repo_dashbord.go b/routers/api/v1/repo/repo_dashbord.go index 9862a7744..52f9f68ce 100644 --- a/routers/api/v1/repo/repo_dashbord.go +++ b/routers/api/v1/repo/repo_dashbord.go @@ -520,8 +520,7 @@ func getTimePeroid(ctx *context.Context, recordBeginTime time.Time) (time.Time, } func getRecordBeginTime() (time.Time, error) { - - return time.Parse(DATE_FORMAT, setting.RadarMap.RecordBeginTime) + return time.ParseInLocation(DATE_FORMAT, setting.RadarMap.RecordBeginTime, time.Local) } func getTotalPage(total int64, pageSize int) int { From ea9ce62849f02ebef2e41b7e57d559bf2831301f Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Fri, 19 Nov 2021 12:25:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=B7=AE8=E5=B0=8F=E6=97=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/api/v1/repo/repo_dashbord.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/repo/repo_dashbord.go b/routers/api/v1/repo/repo_dashbord.go index 52f9f68ce..60f3620ed 100644 --- a/routers/api/v1/repo/repo_dashbord.go +++ b/routers/api/v1/repo/repo_dashbord.go @@ -495,12 +495,12 @@ func getTimePeroid(ctx *context.Context, recordBeginTime time.Time) (time.Time, } else { - beginTime, err = time.Parse("2006-01-02", beginTimeStr) + beginTime, err = time.ParseInLocation("2006-01-02", beginTimeStr, time.Local) if err != nil { return now, now, err } - endTime, err = time.Parse("2006-01-02", endTimeStr) + endTime, err = time.ParseInLocation("2006-01-02", endTimeStr, time.Local) if err != nil { return now, now, err }