summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-11-09 10:09:01 -0300
committerzeripath <art27@cantab.net>2019-11-09 13:09:01 +0000
commita647a54a08fc78286ea6ded008ea368f43e7c2ca (patch)
tree7cd1cf3601077953599409fee837566fe8883c4c /models/issue.go
parent1f3ba6919d35cc37d1d2575a70927986392f12b5 (diff)
downloadgitea-a647a54a08fc78286ea6ded008ea368f43e7c2ca.tar.gz
gitea-a647a54a08fc78286ea6ded008ea368f43e7c2ca.zip
Leave non-dated issues for last (#8871)
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go3
1 files changed, 2 insertions, 1 deletions
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":