mirror of
https://gitee.com/dromara/carbon.git
synced 2024-12-02 04:07:36 +08:00
Update carbon.go
修复IsFirstDay、IsLastDay错误
This commit is contained in:
parent
bcec0e19f0
commit
6137e7b916
@ -373,10 +373,10 @@ func (c *carbon) IsSunday() bool {
|
||||
|
||||
// IsFirstDay 是否月初
|
||||
func (c *carbon) IsFirstDay() bool {
|
||||
return c.Time.In(c.loc).Weekday().String() == "Sunday"
|
||||
return c.time.In(c.loc).Day() == 1
|
||||
}
|
||||
|
||||
// IsLastDay 是否是月末
|
||||
func (c *carbon) IsLastDay() bool {
|
||||
return c.Time.In(c.loc).Weekday().String() == "Sunday"
|
||||
return c.time.In(c.loc).Format("2006-01-02 00:00:00") == c.LastDay()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user