aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base/template.go
diff options
context:
space:
mode:
authorPeter Smit <peter@smitmail.eu>2015-02-16 14:44:27 +0200
committerPeter Smit <peter@smitmail.eu>2015-02-16 14:44:27 +0200
commit7759b9ee6efb069a1f846b43bd6bc981f998e55a (patch)
tree61e95c4db963fbf6eac0dfb7f673de8c58fc13ad /modules/base/template.go
parentd85366930c94145c8f1119ff0b6bb95d77c5200e (diff)
downloadgitea-7759b9ee6efb069a1f846b43bd6bc981f998e55a.tar.gz
gitea-7759b9ee6efb069a1f846b43bd6bc981f998e55a.zip
Remove the "PHP" style formatting function
The "PHP" formatting function doesn't add anything, except an undocumented date format. All usages in the templates have been replaced with DateFmtShort and DateFmtLong for convenience.
Diffstat (limited to 'modules/base/template.go')
-rw-r--r--modules/base/template.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/base/template.go b/modules/base/template.go
index f3fa138578..0fd519e6c5 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -126,8 +126,13 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
return a + b
},
"ActionIcon": ActionIcon,
- "DateFormat": DateFormat,
- "List": List,
+ "DateFmtLong": func(t time.Time) string {
+ return t.Format(time.RFC1123Z)
+ },
+ "DateFmtShort": func(t time.Time) string {
+ return t.Format("Jan 02, 2006")
+ },
+ "List": List,
"Mail2Domain": func(mail string) string {
if !strings.Contains(mail, "@") {
return "try.gogs.io"