From 968fb30f53c80795bdcb81031cd7d3c75fd0bcce Mon Sep 17 00:00:00 2001 From: Niko Abeler Date: Sun, 11 Sep 2022 17:34:50 +0200 Subject: [PATCH] formatted date --- embed/post.html | 2 +- post.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/embed/post.html b/embed/post.html index f42b0d7..8e0e5fe 100644 --- a/embed/post.html +++ b/embed/post.html @@ -4,7 +4,7 @@ Published: # diff --git a/post.go b/post.go index 3bb2e59..7082697 100644 --- a/post.go +++ b/post.go @@ -34,6 +34,10 @@ type PostMeta struct { Draft bool `yaml:"draft"` } +func (pm PostMeta) FormattedDate() string { + return pm.Date.Format("02-01-2006 15:04:05") +} + func (pm *PostMeta) UnmarshalYAML(unmarshal func(interface{}) error) error { type T struct { Title string `yaml:"title"`