Issue is not overdue when it is on the same date #5566#5568
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5568 +/- ##
=========================================
- Coverage 37.81% 37.8% -0.01%
=========================================
Files 322 322
Lines 47458 47463 +5
=========================================
- Hits 17946 17944 -2
- Misses 26926 26933 +7
Partials 2586 2586
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
I'd rather change the behaviour when saving a due date to save it on 23:59:59 instead of 00:00 rather than changing this when showing the due date.
There was a problem hiding this comment.
return util.TimeStampNow() >= issue.DeadlineUnix + util.TimeStamp(time.Hour * 24 / time.Second)There was a problem hiding this comment.
Ok thinking about the solution It would be like this
if form.Deadline != nil && !form.Deadline.IsZero() {
t := form.Deadline
deadLine := time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 0, t.Location())
form.Deadline = &deadLine
deadlineUnix = util.TimeStamp(form.Deadline.Unix())
}This is an example for the issue deadline case. What do you think @lunny, @kolaente, @Bwko, @adelowo ? Maybe this code could be simplified.
There was a problem hiding this comment.
I'd only set it to 23:59:59 if it is set to 00:00:00. Maybe someone wants to use it in some kind of frontend with exact deadlines. Or maybe don't modify it at all on the backend and only in gitea's frontend?
There was a problem hiding this comment.
@rvillablanca I don't against @kolaente 's idea, but that you have to consider old data migration.
There was a problem hiding this comment.
@kolaente I don't think the frontend currently supports exact deadlines.
There was a problem hiding this comment.
I don't think we should support exact deadlines (with time)
There was a problem hiding this comment.
I have changed the behaviour of this, now the time part of a due date of issues and milestones is setted to 23:59:59 at the save/edit moment, this is according to @kolaente's suggestion.
With respect to exact deadlines I think that could be possible but at the moment due dates are being treated like a date and not like timestamp (this at least in the handlers, I know the api supports timestamp), so I believe this could be done in another PR as a new feature.
c596b89 to
244d106
Compare
|
@kolaente need your approval. |
kolaente
left a comment
There was a problem hiding this comment.
Looks good! I think the CI failed though...
This PR fix #5566 so now a due date that is today won't be considered overdue, this applies to milestones and issues.