]> source.dussan.org Git - gitea.git/commitdiff
Leave non-dated issues for last (#8871)
authorguillep2k <18600385+guillep2k@users.noreply.github.com>
Sat, 9 Nov 2019 13:09:01 +0000 (10:09 -0300)
committerzeripath <art27@cantab.net>
Sat, 9 Nov 2019 13:09:01 +0000 (13:09 +0000)
models/issue.go

index 1e9d9731861fe138a4f13a933a357fe076ef1faf..389304853380f4751fdfa824228b92f672b1f67f 100644 (file)
@@ -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":