Skip to content

Commit

Permalink
Merge pull request #33 from keepitlight/develop
Browse files Browse the repository at this point in the history
Add comparison methods for Time type
  • Loading branch information
keepitlight authored Jul 10, 2024
2 parents 75bcab2 + 45e30ef commit afbb432
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions time/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,19 @@ func (t *Time) String() string {
//vs = append(vs, c.String())
return strings.Join(vs, "")
}

func (t *Time) Before(c *Time) bool {
if c == nil {
return false
}
return t.t.Before(c.t)
}
func (t *Time) After(c *Time) bool {
if c == nil {
return true
}
return t.t.After(c.t)
}
func (t *Time) Compare(c *Time) int {
return t.t.Compare(c.t)
}

0 comments on commit afbb432

Please sign in to comment.