aboutsummaryrefslogtreecommitdiff
path: root/local/time.go
diff options
context:
space:
mode:
Diffstat (limited to 'local/time.go')
-rw-r--r--local/time.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/local/time.go b/local/time.go
new file mode 100644
index 0000000..72ff3c6
--- /dev/null
+++ b/local/time.go
@@ -0,0 +1,21 @@
+package local
+
+import (
+ "gopkg.in/yaml.v3"
+ "time"
+)
+
+type PageTime struct {
+ time.Time
+}
+
+var TimeFormat = "01.02.2006 15:04:05 MST"
+
+func (pt *PageTime) UnmarshalYAML(n *yaml.Node) error {
+ t, err := time.Parse(TimeFormat, n.Value)
+ if err != nil {
+ return err
+ }
+ pt.Time = t
+ return nil
+}