From d77d9f39d242b1812dbb710271016744025aa512 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 28 Mar 2021 17:27:15 +0800 Subject: [PATCH] fix parse date bug when month digits not equal 2 --- pkg/services/transactions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/transactions.go b/pkg/services/transactions.go index f9eba1c0..5f031294 100644 --- a/pkg/services/transactions.go +++ b/pkg/services/transactions.go @@ -95,7 +95,7 @@ func (s *TransactionService) GetTransactionsInMonthByPage(uid int64, year int, m return nil, errs.ErrPageCountInvalid } - startTime, err := utils.ParseFromLongDateTime(fmt.Sprintf("%d-%d-01 00:00:00", year, month), utcOffset) + startTime, err := utils.ParseFromLongDateTime(fmt.Sprintf("%d-%02d-01 00:00:00", year, month), utcOffset) if err != nil { return nil, errs.ErrSystemError