Dynamically Populating Current Year in POrtal Footer Text

ShafrazMubarak
Giga Guru

We have our Risk Portal and we need the footer text placed in the footer to dynamically refresh the Copyrights sentance. 

 

Currently, the Body HTML Template field is updated as 

<div class="col-md-12 text-right footer-section">
<div class="copy-rght-txt">© 2023 COmpany Name </div>
</div>

 

We need to replace to dynamically changes the current year. 

1 ACCEPTED SOLUTION

Gopal Allu
Tera Expert

Hi @ShafrazMubarak ,

 

You can write below code in server script:

var a = new GlideDateTime().getYearLocalTime();

data.presentyear = a;

 

HTML:

<div class="col-md-12 text-right footer-section">
<div class="copy-rght-txt">© <span>{{data.presentyear}}</span> COmpany Name </div>
</div>

 

If it is helpful please make it correct/helpful.

 

Thanks and Regards,

Allu Gopal.

View solution in original post

1 REPLY 1

Gopal Allu
Tera Expert

Hi @ShafrazMubarak ,

 

You can write below code in server script:

var a = new GlideDateTime().getYearLocalTime();

data.presentyear = a;

 

HTML:

<div class="col-md-12 text-right footer-section">
<div class="copy-rght-txt">© <span>{{data.presentyear}}</span> COmpany Name </div>
</div>

 

If it is helpful please make it correct/helpful.

 

Thanks and Regards,

Allu Gopal.