Skip to content

Commit 6675c4d

Browse files
authored
Fix/timeformat (#122)
* Fix #121: confused day with month thanks to time.Format * Add outdir template variable example
1 parent 46be48a commit 6675c4d

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright © 2023-2024 Thomas von Dein
2+
Copyright © 2023-2025 Thomas von Dein
33
44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ import (
3434
)
3535

3636
const (
37-
VERSION string = "0.3.16"
37+
VERSION string = "0.3.17"
3838
Baseuri string = "https://www.kleinanzeigen.de"
3939
Listuri string = "/s-bestandsliste.html"
4040
Defaultdir string = "."

example.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ user = 00000000
1212
loglevel = "verbose"
1313

1414
# directory where to store downloaded ads. kleingebaeck will try to
15-
# create it. must be a quoted string.
16-
outdir = "test"
15+
# create it. must be a quoted string. You can also include a couple of
16+
# template variables, e.g:
17+
# outdir = "test-{{.Year}}-{{.Month}}-{{.Day}}"
18+
outdir = "test"
1719

1820
# template for stored adlistings.
1921
template="""

store.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright © 2023-2024 Thomas von Dein
2+
Copyright © 2023-2025 Thomas von Dein
33
44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -44,8 +44,8 @@ func OutDirName(conf *Config) (string, error) {
4444
now := time.Now()
4545
data := OutdirData{
4646
Year: now.Format("2006"),
47-
Month: now.Format("02"),
48-
Day: now.Format("01"),
47+
Month: now.Format("01"),
48+
Day: now.Format("02"),
4949
}
5050

5151
err = tmpl.Execute(&buf, data)

0 commit comments

Comments
 (0)