Show age warning on posts

Is it possible to add a warning on posts that are for example older than 1 year since their year of publication?

I understand that the publication date of the post can be determined with {{date published_at format=(t “MMM DD”)}}, but the current date? {{date}} allows to add the current date and therefore use the conditionals to show or not a warning?


This might be a good spot for some javascript, if you can’t do it in handlebars. Grab the date published from whatever HTML element it’s in, compare to the current date, then change the visibility of some warning element (or create it entirely) if you find the post is old.

I had thought that if there was no other option, the best option was to do it with JS. I think it will be the best option, since I understand that with handlebars it is not possible to do it :/