Fix Date
This commit is contained in:
parent
fb5632c56e
commit
0b8c247045
@ -102,10 +102,8 @@ type PartnerLicense struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *LicenseDB) ToPartnerLicense() PartnerLicense {
|
func (l *LicenseDB) ToPartnerLicense() PartnerLicense {
|
||||||
// Define the GMT+7 timezone
|
|
||||||
location, err := time.LoadLocation("Asia/Jakarta")
|
location, err := time.LoadLocation("Asia/Jakarta")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Handle the error appropriately, but for simplicity, we'll default to UTC
|
|
||||||
location = time.FixedZone("GMT+7", 7*60*60)
|
location = time.FixedZone("GMT+7", 7*60*60)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +139,8 @@ func (l *LicenseDB) ToPartnerLicense() PartnerLicense {
|
|||||||
|
|
||||||
if startDateInGMT7.After(startOfDay) {
|
if startDateInGMT7.After(startOfDay) {
|
||||||
licenseStatus = "INACTIVE"
|
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 {
|
if daysToExpire < 0 {
|
||||||
licenseStatus = "EXPIRED"
|
licenseStatus = "EXPIRED"
|
||||||
} else if daysToExpire <= 30 {
|
} else if daysToExpire <= 30 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user