...
1 package time
2
3 import (
4 arrow "github.com/bmuller/arrow/lib"
5
6 "github.com/noirbizarre/gonja/config"
7 )
8
9 type Config struct {
10
11 DatetimeFormat string
12
13 Now *arrow.Arrow
14 }
15
16 func NewConfig() *Config {
17 return &Config{
18 DatetimeFormat: "%Y-%m-%d",
19 Now: nil,
20 }
21 }
22
23 func (cfg *Config) Inherit() config.Inheritable {
24 return &Config{
25 DatetimeFormat: cfg.DatetimeFormat,
26 Now: cfg.Now,
27 }
28 }
29
30
31 var DefaultConfig = NewConfig()
32
View as plain text