fix milestone format parse

tokarchuk/v1.17
Unknwon 9 years ago
parent 44c32a8a53
commit 77dcef0cab
  1. 2
      conf/locale/locale_en-US.ini
  2. 6
      modules/bindata/bindata.go
  3. 4
      routers/repo/issue.go

@ -406,7 +406,7 @@ milestones.title = Title
milestones.desc = Description
milestones.due_date = Due Date (optional)
milestones.clear = Clear
milestones.invalid_due_date_format = Due date format is invalid, must be 'mm/dd/year'.
milestones.invalid_due_date_format = Due date format is invalid, must be 'year-mm-dd'.
milestones.create_success = Milestone '%s' has been created successfully!
milestones.edit = Edit Milestone
milestones.edit_subheader = Use better description for milestones so people won't be confused.

File diff suppressed because one or more lines are too long

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

Loading…
Cancel
Save