Skip to content

Commit

Permalink
Add getters for individual version components.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndarilek committed Jul 10, 2023
1 parent 56cf73a commit 893bbd8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions calver/calver.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,23 @@ func NewVersion(pattern string, micro int) (*Version, error) {
time: today(),
}, nil
}

func (v *Version) Time() time.Time {
return v.time
}

func (v *Version) Year() int {
return v.time.Year()
}

func (v *Version) Month() int {
return int(v.time.Month())
}

func (v *Version) Day() int {
return v.time.Day()
}

func (v *Version) Micro() int {
return v.micro
}

0 comments on commit 893bbd8

Please sign in to comment.