Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sub
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-07-19 20:07:48 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-07-19 20:16:06 +0300
commit56e4d13179781aee81a32ac6779ad5497f975bf3 (patch)
tree0e71f48477c9caf46d5db44bb18516cc152d53ac /sub
parent0dd0ba717fe88814ce2053c8b6019278fde4bed5 (diff)
change date format to days remaining
example: kkv4fhs4: 5.00GB📊- 6 Days⏳ far6160p: 2.00GB📊- 23 Hours⏳ Co-Authored-By: somebodywashere <68244480+somebodywashere@users.noreply.github.com>
Diffstat (limited to 'sub')
-rw-r--r--sub/subService.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/sub/subService.go b/sub/subService.go
index a4eef647..100d98d3 100644
--- a/sub/subService.go
+++ b/sub/subService.go
@@ -14,7 +14,6 @@ import (
"x-ui/xray"
"github.com/goccy/go-json"
- ptime "github.com/yaa110/go-persian-calendar"
)
type SubService struct {
@@ -827,11 +826,11 @@ func getExpiryTime(expiryTime int64) string {
if expiryTime == 0 {
expiryString = "♾ ⏳"
} else if timeDifference > 172800 {
- expiryString = fmt.Sprintf("%s ⏳", ptime.Unix((expiryTime/1000), 0).Format("yy-MM-dd hh:mm"))
+ expiryString = fmt.Sprintf("%d %s⏳", timeDifference/86400, "Days")
} else if expiryTime < 0 {
- expiryString = fmt.Sprintf("%d ⏳", expiryTime/-86400000)
+ expiryString = fmt.Sprintf("%d %s⏳", expiryTime/-86400000, "Days")
} else {
- expiryString = fmt.Sprintf("%s %d ⏳", "ساعت", timeDifference/3600)
+ expiryString = fmt.Sprintf("%d %s⏳", timeDifference/3600, "Hours")
}
return expiryString