mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
helper: Now identifies holidays
This commit is contained in:
parent
2c1dc654b4
commit
54abd9153f
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue