1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Fix legacy detection

This commit is contained in:
Lunny Xiao 2024-10-29 22:05:32 -07:00
parent 6d0f84029c
commit efc2d201fb
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -260,10 +260,7 @@ func ToAPIMilestone(m *issues_model.Milestone) *api.Milestone {
if m.IsClosed {
apiMilestone.Closed = m.ClosedDateUnix.AsTimePtr()
}
// for legacy reasons, all years after 9000 are considered as no deadline
if m.DeadlineUnix.Year() > 9000 || m.DeadlineUnix == 0 {
apiMilestone.Deadline = nil
} else {
if m.DeadlineUnix > 0 {
apiMilestone.Deadline = m.DeadlineUnix.AsTimePtr()
}
return apiMilestone