Is there a way to create a number to increment automatically based upon the current year of January?
A client has inline content “…for nearly 15 years…” and wants the number to increase every year by January of the current year. Is this possible with JavaSscript?
I’m sure it is.
Without code, but explaining the concept.
You know the year they were founded.
JS can get the current year.
You subtract one from the other to calculate the years elapsed between then and now.
The maths is easy. More annoyingly will be when someone points out that it cant be ‘nearly’ X years if they were founded in January and the current month is February, as you’re 11 months off from the value of X