Skip to content

Issue due date is always one day plus #5890

Closed
@neolithos

Description

@neolithos
  • Gitea version (or commit ref): 8006b1b
  • Git version:
  • Operating system: Windows 2012 R2 (English, Timezone Germany/Berlin)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I set a issue due date, and it shows the date in views one day plus.

  • In the database I see the correct timestamp, 1549411199 -> 2019-02-05T23:59:59.
  • If I open the editor, there is also the correct stamp -> correct.
  • In issue overview, history and the issue it self I see the date always one day plus -> wrong.
  • Over due calculation -> correct.

Screenshots

issue_due

Code

I would fix it, but I have no glue, what is indented. So, I give the lines they are responsible.

Save

var deadlineUnix util.TimeStamp
if form.Deadline != nil && !form.Deadline.IsZero() && ctx.Repo.CanWrite(models.UnitTypeIssues) {
deadlineUnix = util.TimeStamp(form.Deadline.Unix())
}

var deadlineUnix util.TimeStamp
var deadline time.Time
if form.Deadline != nil && !form.Deadline.IsZero() {
deadline = time.Date(form.Deadline.Year(), form.Deadline.Month(), form.Deadline.Day(),
23, 59, 59, 0, form.Deadline.Location())
deadlineUnix = util.TimeStamp(deadline.Unix())
}

Get

apiIssue.Deadline = issue.DeadlineUnix.AsTimePtr()

AsTimePtr add's the local timezone, if i understand it correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implemented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions