helper: Now identifies holidays

This commit is contained in:
Paul Beckingham 2016-05-22 10:33:53 -04:00
parent 2c1dc654b4
commit 54abd9153f

View file

@ -235,10 +235,12 @@ int quantizeTo15Minutes (const int minutes)
}
////////////////////////////////////////////////////////////////////////////////
// Check rules to see if day is a holiday.
bool dayIsHoliday (const Rules& rules, const Datetime& day)
{
// TODO Look up exclusions.
for (auto& holiday : rules.all ("holidays."))
if (day.sameDay (Datetime (holiday.substr (holiday.length () - 10), "Y_M_D")))
return true;
return false;
}