I'm working on a project in which I need to find what days are holidays, and display specific messages for those holidays.
With some holidays, like Christmas, it is simply the 25th of December. But for other holidays, such as thanksgiving, it is a little tricky in that it is the 4th Thursday in November.
The approach I'm using is splitting up which week.
day = moment()
month = day.month() + 1
weeknum = Math.floor((day - 1) / 7) + 1
holiday2 = month + "/" + weeknum + "/" + day
Today happens to be columbus day, and so based off of what I have, it should be '10/2/1'. 10th month, 2nd week, 1st day. (10/12). The problem that I am getting, is with what I have right now for holiday2, I am getting:
10/206381035675/1444667249719
So...I know technically I'm close in that I see the '10/2/1' but I am getting very large abnormal numbers.
My question is 2 fold. How would I condense the numbers so that instead of getting a 10 digit response, I would get just the 1 or two digits that I need?
Would there be a better way to approach this?