diff --git a/CHANGELOG.md b/CHANGELOG.md index a97983e..6fc18ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [0.5.4] - 2024-03-29 +### Fixed +- MonthRange function returned first day of next month which causes invalid summaries + ## [0.5.3] - 2024-03-27 ### Fixed - calendar controls not working while focus is on latest issues view @@ -85,7 +89,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - Initial release of gojira -[Unreleased]: https://github.com/jzyinq/gojira/compare/0.5.3...master +[Unreleased]: https://github.com/jzyinq/gojira/compare/0.5.4...master +[0.5.4]: https://github.com/jzyinq/gojira/compare/0.5.3...0.5.4 [0.5.3]: https://github.com/jzyinq/gojira/compare/0.5.2...0.5.3 [0.5.2]: https://github.com/jzyinq/gojira/compare/0.5.1...0.5.2 [0.5.1]: https://github.com/jzyinq/gojira/compare/0.5.0...0.5.1 diff --git a/gojira/utils.go b/gojira/utils.go index ddc0626..7ab4c36 100644 --- a/gojira/utils.go +++ b/gojira/utils.go @@ -114,6 +114,6 @@ func OpenURL(url string) { func MonthRange(t *time.Time) (time.Time, time.Time) { firstDayOfCurrentMonth := time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, t.Location()) - firstDayOfNextMonth := firstDayOfCurrentMonth.AddDate(0, 1, 0) - return firstDayOfCurrentMonth, firstDayOfNextMonth + lastDayOfCurrentMonth := firstDayOfCurrentMonth.AddDate(0, 1, 0).Add(-time.Second) + return firstDayOfCurrentMonth, lastDayOfCurrentMonth } diff --git a/gojira/worklog.go b/gojira/worklog.go index 55853b4..232b354 100644 --- a/gojira/worklog.go +++ b/gojira/worklog.go @@ -90,7 +90,7 @@ func (wl *Worklogs) TotalTimeSpentToPresentDay() int { if err != nil { logrus.Error(err) } - if logDate.Before(time.Now().Local()) { + if logDate.Before(time.Now().UTC()) { totalTime += log.TimeSpentSeconds } }