Skip to content

Commit 31d06cd

Browse files
Simplify date calculations (#974)
1 parent 31a4c0a commit 31d06cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ end
3030
Plug in the list of blog posts contained in the `/blog/` folder.
3131
"""
3232
function hfun_blogposts()
33-
curyear = Dates.Year(Dates.today()).value
33+
curyear = year(Dates.today())
3434
io = IOBuffer()
3535
for year in curyear:-1:2012
3636
ys = "$year"
3737
year < curyear && write(io, "\n**$year**\n")
3838
for month in 12:-1:1
39-
ms = "0"^(1-div(month, 10)) * "$month"
39+
ms = "0"^(month < 10) * "$month"
4040
base = joinpath("blog", ys, ms)
4141
isdir(base) || continue
4242
posts = filter!(p -> endswith(p, ".md"), readdir(base))

0 commit comments

Comments
 (0)