diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-12-28 18:09:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 10:09:57 +0000 |
commit | e743570f65b533552337d9606ac1d906ec054127 (patch) | |
tree | 55042505c0618b567e7f30e7334ec6d66db86230 /models/issues/comment.go | |
parent | f3999888c0b765380003f814f9c3d5cf80128167 (diff) | |
download | gitea-e743570f65b533552337d9606ac1d906ec054127.tar.gz gitea-e743570f65b533552337d9606ac1d906ec054127.zip |
Refactor timeutil package (#28623)
1. make names more readable
2. remove unused FormatLong/FormatShort
3. use `FormatDate` instead of `Format "2006-01-02"`
Diffstat (limited to 'models/issues/comment.go')
-rw-r--r-- | models/issues/comment.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/issues/comment.go b/models/issues/comment.go index ba5aed9c65..d92e49a444 100644 --- a/models/issues/comment.go +++ b/models/issues/comment.go @@ -899,15 +899,15 @@ func createDeadlineComment(ctx context.Context, doer *user_model.User, issue *Is // newDeadline = 0 means deleting if newDeadlineUnix == 0 { commentType = CommentTypeRemovedDeadline - content = issue.DeadlineUnix.Format("2006-01-02") + content = issue.DeadlineUnix.FormatDate() } else if issue.DeadlineUnix == 0 { // Check if the new date was added or modified // If the actual deadline is 0 => deadline added commentType = CommentTypeAddedDeadline - content = newDeadlineUnix.Format("2006-01-02") + content = newDeadlineUnix.FormatDate() } else { // Otherwise modified commentType = CommentTypeModifiedDeadline - content = newDeadlineUnix.Format("2006-01-02") + "|" + issue.DeadlineUnix.Format("2006-01-02") + content = newDeadlineUnix.FormatDate() + "|" + issue.DeadlineUnix.FormatDate() } if err := issue.LoadRepo(ctx); err != nil { |