HUGO

Check if two dates are on the same day

There are more ways to do this, but this is what I came up with:

{{ if and (eq .PublishDate.Year .Lastmod.Year) (eq .PublishDate.YearDay .Lastmod.YearDay) }}
{{ end }}

A little clunky, but it works.

2 Likes