Skip to content

Commit

Permalink
Optimize IsValid method
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Nov 28, 2024
1 parent c4bb05a commit 24a388f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions comparer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ func (c Carbon) IsValid() bool {
if c.time.IsZero() {
return false
}
// 大于零值时间
if c.StdTime().Unix() > -62135596800 {
if c.Year() >= MinCarbon().Year() && c.Year() <= MaxCarbon().Year() {
return true
}
return false
Expand Down

0 comments on commit 24a388f

Please sign in to comment.