``feat(item): 新增物品出售价格属性(SellPrice)并实现物品出售功能,优化宠物面板计算和时区判断逻辑``
This commit is contained in:
@@ -59,15 +59,14 @@ func IsToday(t1 *gtime.Time) bool {
|
||||
if t1 == nil {
|
||||
return false
|
||||
}
|
||||
t := t1.Time
|
||||
|
||||
// 获取当前时间
|
||||
now := time.Now()
|
||||
// 统一转换为 UTC 时区
|
||||
tUTC := t1.Time.UTC()
|
||||
// 截断 UTC 时间到当天 00:00:00
|
||||
nowUTC := time.Now().UTC().Truncate(24 * time.Hour)
|
||||
tTrunc := tUTC.Truncate(24 * time.Hour)
|
||||
|
||||
// 比较年、月、日是否相同
|
||||
return t.Year() == now.Year() &&
|
||||
t.Month() == now.Month() &&
|
||||
t.Day() == now.Day()
|
||||
return nowUTC.Equal(tTrunc)
|
||||
}
|
||||
|
||||
type TaskService struct {
|
||||
|
||||
Reference in New Issue
Block a user