1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-04 00:28:36 +00:00

Replace DateTime with proper functions (#32402)

Follow #32383

This PR cleans up the "Deadline" usages in templates, make them call
`ParseLegacy` first to get a `Time` struct then display by `DateUtils`.

Now it should be pretty clear how "deadline string" works, it makes it
possible to do further refactoring and correcting.
This commit is contained in:
wxiaoguang
2024-11-03 05:04:53 +08:00
committed by GitHub
parent e524f63d58
commit 259811617b
8 changed files with 59 additions and 35 deletions

View File

@@ -38,7 +38,7 @@
{{if .Milestone.DeadlineString}}
<span{{if .IsOverdue}} class="text red"{{end}}>
{{svg "octicon-calendar"}}
{{DateTime "short" .Milestone.DeadlineString}}
{{ctx.DateUtils.AbsoluteShort (.Milestone.DeadlineString|ctx.DateUtils.ParseLegacy)}}
</span>
{{else}}
{{svg "octicon-calendar"}}