From dbc909c736905fb21c209cb75b3e3223709079ee Mon Sep 17 00:00:00 2001 From: luorijun Date: Tue, 19 May 2026 13:35:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=95=BF=E6=95=88=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/u/u.go | 12 ++++++------ web/services/channel.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/u/u.go b/pkg/u/u.go index c757a5b..6a0c1c3 100644 --- a/pkg/u/u.go +++ b/pkg/u/u.go @@ -91,14 +91,14 @@ func DateTail(date time.Time) time.Time { return time.Date(y, m, d, 23, 59, 59, 999999999, time.Local).UTC() } -func Today() time.Time { - return DateHead(time.Now()) +func IsSameDate(date1, date2 time.Time) bool { + var y1, m1, d1 = date1.Local().Date() + var y2, m2, d2 = date2.Local().Date() + return y1 == y2 && m1 == m2 && d1 == d2 } -func IsSameDate(date1, date2 time.Time) bool { - var y1, m1, d1 = date1.Date() - var y2, m2, d2 = date2.Date() - return y1 == y2 && m1 == m2 && d1 == d2 +func Today() time.Time { + return DateHead(time.Now()) } func IsToday(date time.Time) bool { diff --git a/web/services/channel.go b/web/services/channel.go index 211f2e3..fb35d67 100644 --- a/web/services/channel.go +++ b/web/services/channel.go @@ -157,7 +157,7 @@ func findResource(resourceId int32, now time.Time) (*ResourceView, error) { var sub = resource.Long info.LongId = &sub.ID info.ExpireAt = sub.ExpireAt - info.Live = time.Duration(sub.Live) * time.Hour + info.Live = time.Duration(sub.Live) * time.Minute info.Mode = sub.Type info.Quota = sub.Quota info.Used = sub.Used