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:
parent
6d0f84029c
commit
efc2d201fb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user