Skip to content

Commit

Permalink
change date format to days remaining
Browse files Browse the repository at this point in the history
example:
kkv4fhs4: 5.00GB📊- 6 Days⏳
far6160p: 2.00GB📊- 23 Hours⏳
Co-Authored-By: somebodywashere <[email protected]>
  • Loading branch information
MHSanaei and somebodywashere committed Jul 19, 2023
1 parent 0dd0ba7 commit 56e4d13
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require (
github.com/robfig/cron/v3 v3.0.1
github.com/shirou/gopsutil/v3 v3.23.6
github.com/xtls/xray-core v1.8.3
github.com/yaa110/go-persian-calendar v1.1.5
go.uber.org/atomic v1.11.0
golang.org/x/text v0.11.0
google.golang.org/grpc v1.56.2
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ github.com/xtls/reality v0.0.0-20230613075828-e07c3b04b983 h1:AMyzgjkh54WocjQSlC
github.com/xtls/reality v0.0.0-20230613075828-e07c3b04b983/go.mod h1:rkuAY1S9F8eI8gDiPDYvACE8e2uwkyg8qoOTuwWov7Y=
github.com/xtls/xray-core v1.8.3 h1:lxaVklPjLKqUU4ua4qH8SBaRcAaNHlH+LmXOx0U/Ejg=
github.com/xtls/xray-core v1.8.3/go.mod h1:i7t4JFnq828P2+XK0XjGQ8W9x78iu+EJ7jI4l3sonIw=
github.com/yaa110/go-persian-calendar v1.1.5 h1:EUipRRhzE6bR2NZaSyZ5BEOP46LGbUjzQgdC+Ivrbe4=
github.com/yaa110/go-persian-calendar v1.1.5/go.mod h1:qtnmHCS9u1EiwzzSCSttGoxD5NfV9ZMzymxFCBYmqfg=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down
7 changes: 3 additions & 4 deletions sub/subService.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"x-ui/xray"

"github.com/goccy/go-json"
ptime "github.com/yaa110/go-persian-calendar"
)

type SubService struct {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 56e4d13

Please sign in to comment.