private function itemizeDays($db_events, $itemized, $unit, $keyed_units) {
    $result = array();

    foreach ($itemized[Event::BAT_DAY] as $year => $months) {
      foreach ($months as $month => $days) {
        // Check if month is defined in DB otherwise set to default value
        if (isset($db_events[$unit][Event::BAT_DAY][$year][$month])) {
          foreach ($days as $day => $value) {
            $result[$year][$month][$day] = ((int)$db_events[$unit][Event::BAT_DAY][$year][$month][$day] == 0 ? $keyed_units[$unit]->getDefaultValue() : (int)$db_events[$unit][Event::BAT_DAY][$year][$month][$day]);
          }
        }
        else {
          foreach ($days as $day => $value) {
            $result[$year][$month][$day] = $keyed_units[$unit]->getDefaultValue();
          }
        }
      }
    }

    return $result;
  }