Added check for begin > finish time

This commit is contained in:
マリウス 2020-10-11 21:14:36 +01:00
parent b95c00a12d
commit 05f387b42a
No known key found for this signature in database
GPG key ID: C228EF0A530AF06F

View file

@ -41,6 +41,10 @@ func NewEntry(
}
}
if finishTime.Before(beginTime) && finishTime.IsZero() == false {
return Entry{}, errors.New("Beginning time of tracking cannot be after the finish time!")
}
return Entry{
id,
beginTime,