From 0b8c247045d074fbab03293907e34ccb4ef37af2 Mon Sep 17 00:00:00 2001 From: "aditya.siregar" Date: Wed, 28 Aug 2024 12:56:44 +0700 Subject: [PATCH] Fix Date --- internal/entity/license.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/entity/license.go b/internal/entity/license.go index 2985c70..efb2b83 100644 --- a/internal/entity/license.go +++ b/internal/entity/license.go @@ -102,10 +102,8 @@ type PartnerLicense struct { } func (l *LicenseDB) ToPartnerLicense() PartnerLicense { - // Define the GMT+7 timezone location, err := time.LoadLocation("Asia/Jakarta") if err != nil { - // Handle the error appropriately, but for simplicity, we'll default to UTC location = time.FixedZone("GMT+7", 7*60*60) } @@ -141,7 +139,8 @@ func (l *LicenseDB) ToPartnerLicense() PartnerLicense { if startDateInGMT7.After(startOfDay) { licenseStatus = "INACTIVE" - } else if startDateInGMT7.Equal(startOfDay) || (startDateInGMT7.Before(startOfDay) && endDateInGMT7.After(startOfDay)) { + } else if startDateInGMT7.Equal(startOfDay) || (startDateInGMT7.Before(startOfDay) && endDateInGMT7.After(startOfDay) || + endDateInGMT7.Equal(startOfDay)) { if daysToExpire < 0 { licenseStatus = "EXPIRED" } else if daysToExpire <= 30 {