Fix template function DateTime (#24317)

Before, 500 error


![image](https://user-images.githubusercontent.com/2114189/234170176-403ffd1b-ec27-42be-bff9-86184dc8d74d.png)
This commit is contained in:
wxiaoguang 2023-04-26 03:48:30 +08:00 committed by GitHub
parent 9219534447
commit 0e8045d8ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 140 additions and 60 deletions

View file

@ -115,7 +115,7 @@ func timeSincePro(then, now time.Time, lang translation.Locale) string {
}
func timeSinceUnix(then, now time.Time, lang translation.Locale) template.HTML {
friendlyText := then.Format("2006-01-02 15:04:05 +07:00")
friendlyText := then.Format("2006-01-02 15:04:05 -07:00")
// document: https://github.com/github/relative-time-element
attrs := `tense="past"`