Browse Source

Merge pull request #2565 from tkausl/issue2563

fixes #2563
for-closed-social
Unknwon 8 years ago
parent
commit
10fbb1aa2f
2 changed files with 3 additions and 2 deletions
  1. +1
    -0
      models/issue.go
  2. +2
    -2
      routers/repo/issue.go

+ 1
- 0
models/issue.go View File

@ -1179,6 +1179,7 @@ func (m *Milestone) AfterSet(colName string, _ xorm.Cell) {
if m.Deadline.Year() == 9999 {
return
}
m.Deadline = regulateTimeZone(m.Deadline)
m.DeadlineString = m.Deadline.Format("2006-01-02")
if time.Now().After(m.Deadline) {

+ 2
- 2
routers/repo/issue.go View File

@ -1079,7 +1079,7 @@ func NewMilestonePost(ctx *middleware.Context, form auth.CreateMilestoneForm) {
if len(form.Deadline) == 0 {
form.Deadline = "9999-12-31"
}
deadline, err := time.Parse("2006-01-02", form.Deadline)
deadline, err := time.ParseInLocation("2006-01-02", form.Deadline, time.Local)
if err != nil {
ctx.Data["Err_Deadline"] = true
ctx.RenderWithErr(ctx.Tr("repo.milestones.invalid_due_date_format"), MILESTONE_NEW, &form)
@ -1139,7 +1139,7 @@ func EditMilestonePost(ctx *middleware.Context, form auth.CreateMilestoneForm) {
if len(form.Deadline) == 0 {
form.Deadline = "9999-12-31"
}
deadline, err := time.Parse("2006-01-02", form.Deadline)
deadline, err := time.ParseInLocation("2006-01-02", form.Deadline, time.Local)
if err != nil {
ctx.Data["Err_Deadline"] = true
ctx.RenderWithErr(ctx.Tr("repo.milestones.invalid_due_date_format"), MILESTONE_NEW, &form)

Loading…
Cancel
Save