diff --git a/models/issue.go b/models/issue.go
index 396c029d4..0429ac4c8 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1279,6 +1279,10 @@ func sortIssuesSession(sess *xorm.Session, sortType string) {
sess.Asc("issue.num_comments")
case "priority":
sess.Desc("issue.priority")
+ case "nearduedate":
+ sess.Asc("issue.deadline_unix")
+ case "farduedate":
+ sess.Desc("issue.deadline_unix")
default:
sess.Desc("issue.created_unix")
}
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index c5a62cb48..f188f1f2a 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -722,6 +722,8 @@ issues.filter_sort.recentupdate = Recently updated
issues.filter_sort.leastupdate = Least recently updated
issues.filter_sort.mostcomment = Most commented
issues.filter_sort.leastcomment = Least commented
+issues.filter_sort.nearduedate = Nearest due date
+issues.filter_sort.farduedate = Farthest due date
issues.filter_sort.moststars = Most stars
issues.filter_sort.feweststars = Fewest stars
issues.filter_sort.mostforks = Most forks
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 023dfecec..758b64f27 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -106,6 +106,8 @@
{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}
{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}
{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}
+ {{.i18n.Tr "repo.issues.filter_sort.nearduedate"}}
+ {{.i18n.Tr "repo.issues.filter_sort.farduedate"}}
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index fe27a4439..b5990e61e 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -53,6 +53,8 @@
{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}
{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}
{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}
+ {{.i18n.Tr "repo.issues.filter_sort.nearduedate"}}
+ {{.i18n.Tr "repo.issues.filter_sort.farduedate"}}