I have this simple code to determine if the current date is part of the Fiscal Year 2014 or not. It sets a range between October 1, 2013 to September 30, 2014. Any date in that range will be considered Fiscal Year 2014:
var FYFirst = 2013,
FYLast = 2014,
beginningFY = new Date(FYFirst,9,1), //October 1
endFY = new Date(FYLast,8,30), //September 30
todayDate = new Date();
if (todayDate > beginningFY && todayDate < endFY ) { alert("FY 2014"); }
else { alert("Not this FY"); }
I would like to dynamically change FYFirst and FYLast. The way I wrote it, every October I would have to come and change it manually. I would appreciate any new ideas. thanks!