Garbage solution for updating the year displayed in my website needs improvement and needs to work
Answered
Basense posted this in #help-forum
BasenseOP
I want to update my copyright to the current year, so it doesn't have to be done manually every year. (Yeah, I'm lazy, but I also don't want it to ever display some date 6 years ago)
I'd also appreciate to know what date time objects are in ts
Error:
TS2552: Cannot find name 'date'. Did you mean 'Date'?
const localDate: any = date.getFullYear();
const localYear: any = String(localDate);
<span className="basis-1/4">
<p className="text-md">© {localYear} [insert company name] </p>
</span>
I'd also appreciate to know what date time objects are in ts
Error:
TS2552: Cannot find name 'date'. Did you mean 'Date'?
const localDate: any = date.getFullYear();
const localYear: any = String(localDate);
<span className="basis-1/4">
<p className="text-md">© {localYear} [insert company name] </p>
</span>
2 Replies
@@ts-ignore ts
new Date().getFullYear()
BasenseOP
Thank you! :D