1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: make summary include timestamp of first and last heartbeat (resolve #18)

This commit is contained in:
Ferdinand Mütsch
2020-08-23 13:10:58 +02:00
parent 7818f6b094
commit ada0863f7c
3 changed files with 21 additions and 5 deletions

View File

@ -15,12 +15,12 @@ func StartOfWeek() time.Time {
func StartOfMonth() time.Time {
ref := time.Now()
return time.Date(ref.Year(), ref.Month(), 0, 0, 0, 0, 0, ref.Location())
return time.Date(ref.Year(), ref.Month(), 1, 0, 0, 0, 0, ref.Location())
}
func StartOfYear() time.Time {
ref := time.Now()
return time.Date(ref.Year(), time.January, 0, 0, 0, 0, 0, ref.Location())
return time.Date(ref.Year(), time.January, 1, 0, 0, 0, 0, ref.Location())
}
// https://stackoverflow.com/a/18632496