From: Carnë D. <car...@gm...> - 2012-10-27 13:50:35
|
On 27 October 2012 14:46, Carnë Draug <car...@gm...> wrote: > On 26 October 2012 15:24, <lit...@ya...> wrote: >> Hi Carnë, >> >> After more careful inspection, it appears that when New Years Day falls on a Saturday, the holiday is not observed at all. The holidays function does not check that, so modifying line 41 will fix that (and also allow holidays to pass its test). So please disregard the previous code change suggestion, and consider the following instead. >> >> from holidays.m: >> ------------------------------------------ >> ## New Year's Day >> tmphol = datenum (yrs, 1, 1); >> hol = [hol; tmphol(weekday(tmphol(:)) ~= 7)(:)]; >> ------------------------------------------ >> I modified the last line from >> hol = [hol; tmphol(:)]; >> >> Thanks for the link. I will submit octave-forge bugs there in the future. Should I open up a new thread there for this bug, or is that unnecessary? >> >> -Randy Chamberlin > > Hi Randy > > not necessary this time. I have commited your changes see > https://sourceforge.net/p/octave/code/11368 I was taking a closer look at the function and noticed the block near the end that is meant to adjust for sundays and saturdays. wd = weekday (hol); if any (wd == 1) hol(wd == 1) = hol(wd == 1) + 1; endif if any (wd == 7) hol(wd == 7) = hol(wd == 7) - 1; endif I believe that a better fix should go in here. Carnë |