types: improve order string format

This commit is contained in:
c9s 2023-09-17 18:08:57 +08:00
parent 8314a7e750
commit 4b78bfcdfa
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -336,10 +336,12 @@ func (o Order) String() string {
desc += " | " + string(o.Status) + " | "
desc += time.Time(o.CreationTime).UTC().Format(time.StampMilli)
if time.Time(o.UpdateTime).IsZero() {
desc += "0/" + time.Time(o.CreationTime).UTC().Format(time.StampMilli)
desc += " -> 0"
} else {
desc += time.Time(o.UpdateTime).UTC().Format(time.StampMilli) + "/" + time.Time(o.CreationTime).UTC().Format(time.StampMilli)
desc += " -> " + time.Time(o.UpdateTime).UTC().Format(time.StampMilli)
}
return desc