Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package timeago |
||
2 | |||
3 | type Config struct { |
||
4 | Language string |
||
5 | |||
6 | // Location is the timezone location neeed for parsing |
||
7 | // string date like "2019-01-01 00:00:00" to time.Time. |
||
8 | // If Location is not set it will default to the server's. |
||
9 | // Example: "America/New_York", "Asia/China" |
||
10 | Location string |
||
11 | |||
12 | Translations []Translation |
||
13 | } |
||
14 | |||
15 | func NewConfig(lang, loc string, trans []Translation) *Config { |
||
16 | return &Config{ |
||
17 | Language: lang, |
||
18 | Location: loc, |
||
19 | Translations: trans, |
||
20 | } |
||
21 | } |
||
22 | |||
23 | func (c Config) LocationIsSet() bool { |
||
24 | return c.Location != "" |
||
25 | } |
||
26 |