diff --git a/datetime/minutes.go b/datetime/minutes.go index 9686aa6..6347559 100644 --- a/datetime/minutes.go +++ b/datetime/minutes.go @@ -20,7 +20,7 @@ func ParseMinutes(s string) (Minutes, error) { return Minutes{}, err } - return Minutes{duration: d.Truncate(time.Minute)}, nil + return Minutes{duration: d.Round(time.Minute)}, nil } func (m Minutes) Value() int { diff --git a/datetime/minutes_test.go b/datetime/minutes_test.go index 6508e7c..41a8fb3 100644 --- a/datetime/minutes_test.go +++ b/datetime/minutes_test.go @@ -13,7 +13,7 @@ func Test_ParseMinutes(t *testing.T) { assert.Nil(t, err) assert.Equal(t, expected, actual) - actual, err = datetime.ParseMinutes("23m11s") + actual, err = datetime.ParseMinutes("22m33s") assert.Nil(t, err) assert.Equal(t, expected, actual)