Missing '()' invoking a constructor
It is the new Date
part that is causing the warning. This will fix it:
var currentYear = (new Date()).getFullYear();
You are missing the brackets for Date
, it should be Date()
So:
var currentYear = (new Date()).getFullYear();