최근 검색


최근 검색 없음

Any way to make year in the footer dynamic?



2025년 1월 28일에 게시됨

Any way to make current year in the footer dynamic? Ideally without using JavaScript. Something like this:

{{date "" format="YYYY"}}

0

2

댓글 2개

image avatar

Erica Girges

Zendesk Developer Advocacy

Hi Arthur, 
 
Unfortunately, I'm not sure there's a way to change it dynamically without Javascript. If you could provide a little more context on your use case maybe I can elp provide an alternate solution. 

0


Hey Erica,
 

We're using Help Center .hbs templates for the footer.
 

Example:

←footer.hbs→
<footer>
	<p>
		© 2024. All rights reserved.
	</p>
</footer>

 

I was wondering if there's a way to get the current year using the templating language. Right now, we have to update it manually every year.

I found the date helper, but I'm not sure how to use it to get the current year or can we format it to include only year.

One idea is to wrap the year in a <span> and update it dynamically using JavaScript, but that might cause a flash when the script runs. Is that the best approach, or is there a better way?

Thanks!

0


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물