cmd/site: change date format (#89)
* cmd/site: change date format * internal: begone comma
This commit is contained in:
parent
267176954f
commit
78e50f6ce0
|
@ -120,7 +120,6 @@ func (s *Site) showTalk(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const dateFormat = `2006-01-02`
|
|
||||||
h := s.renderTemplatePage("talkpost.html", struct {
|
h := s.renderTemplatePage("talkpost.html", struct {
|
||||||
Title string
|
Title string
|
||||||
Link string
|
Link string
|
||||||
|
@ -131,7 +130,7 @@ func (s *Site) showTalk(w http.ResponseWriter, r *http.Request) {
|
||||||
Title: p.Title,
|
Title: p.Title,
|
||||||
Link: p.Link,
|
Link: p.Link,
|
||||||
BodyHTML: p.BodyHTML,
|
BodyHTML: p.BodyHTML,
|
||||||
Date: p.Date.Format(dateFormat),
|
Date: internal.IOS13Detri(p.Date),
|
||||||
SlidesLink: p.SlidesLink,
|
SlidesLink: p.SlidesLink,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -173,7 +172,6 @@ func (s *Site) showPost(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const dateFormat = `2006-01-02`
|
|
||||||
s.renderTemplatePage("blogpost.html", struct {
|
s.renderTemplatePage("blogpost.html", struct {
|
||||||
Title string
|
Title string
|
||||||
Link string
|
Link string
|
||||||
|
@ -185,7 +183,7 @@ func (s *Site) showPost(w http.ResponseWriter, r *http.Request) {
|
||||||
Title: p.Title,
|
Title: p.Title,
|
||||||
Link: p.Link,
|
Link: p.Link,
|
||||||
BodyHTML: p.BodyHTML,
|
BodyHTML: p.BodyHTML,
|
||||||
Date: p.Date.Format(dateFormat),
|
Date: internal.IOS13Detri(p.Date),
|
||||||
Series: p.Series,
|
Series: p.Series,
|
||||||
SeriesTag: strings.ReplaceAll(p.Series, "-", ""),
|
SeriesTag: strings.ReplaceAll(p.Series, "-", ""),
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package internal
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
const iOS13DetriFormat = `Y2006 M01 2 Mon`
|
||||||
|
|
||||||
|
// IOS13Detri formats a datestamp like iOS 13 does with the Lojban locale.
|
||||||
|
func IOS13Detri(t time.Time) string {
|
||||||
|
return t.Format(iOS13DetriFormat)
|
||||||
|
}
|
Loading…
Reference in New Issue