Subject: | infinite loop in Date_PrevWorkDay |
use Date::Manip;
$x = Date_PrevWorkDay("Wednesday", 0, "19:00"); # infinite loop
print $x, "\n";
Source of the problem is easy to see in the code:
1. Date_PrevWorkDay sets time to WorkDayEnd.
2. Date_IsWorkDay uses "ge" comparison on time, always returning 0.
3. Ergo, infinite loop near line 3730. (version 5.44)
Not wanting to break Date_NextWorkDay or the established "quirks" of Business Mode, I leave the fix (and regression tests?!) to the author.