1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +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

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