This commit is contained in:
aditya.siregar 2024-08-28 12:56:44 +07:00
parent fb5632c56e
commit 0b8c247045

View File

@ -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 {