http://www.perlmonks.org?node_id=1148794


in reply to Re^5: Date::Manip Sunday Holidays
in thread Date::Manip Sunday Holidays

Unfortunately, it appears that I didn't get the right answer. Going back and rereading it (more carefully this time around), the desired date of New Years is:

1/1 if 1/1 is Mon-Fri OR Sat 1/2 if 1/1 is Sun

That's much more complicated. I found something that I thought would work...

1*1:0:1:0:0:0*NBD,BD1,IBD,FD1 = New Year's Day (Saturday) 1*1:0:1:0:0:0*NBD,BD1,NBD,FD2 = New Year's Day (Sunday observed Mon +day) 1*1:0:1:0:0:0*IBD = New Year's Day (real)

but it is failing on some years. I actually think it might be a bug. I'll check into it tomorrow.

I have definitely decided that I need to add a couple more modifiers similar to IBD and NBD which will check if it is a given day of the week. That would make this much simpler. I hadn't been aware of the complexity of the holiday definition used here.