From a647a54a08fc78286ea6ded008ea368f43e7c2ca Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Sat, 9 Nov 2019 10:09:01 -0300 Subject: [PATCH] Leave non-dated issues for last (#8871) --- models/issue.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index 1e9d973186..3893048533 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1075,7 +1075,8 @@ func sortIssuesSession(sess *xorm.Session, sortType string, priorityRepoID int64 case "priority": sess.Desc("issue.priority") case "nearduedate": - sess.Asc("issue.deadline_unix") + // 253370764800 is 01/01/9999 @ 12:00am (UTC) + sess.OrderBy("CASE WHEN issue.deadline_unix = 0 THEN 253370764800 ELSE issue.deadline_unix END ASC") case "farduedate": sess.Desc("issue.deadline_unix") case "priorityrepo":