Bitter
Bitter copied to clipboard
Add a class to get count for an Event by month or week or day
Something like:
$lastYear = new Year(new DateTime('last year'));
$stats = $bitter->getStats('action', $lastYear, 'month');
$max = $stats->getMax();
foreach ($stats as $stat) {
echo $stat->getDate() . ' - ' . $stat->getCount() . "\n";
}
$lastyear = new \DatePeriod(new \DateTime('......'), new \DateTime('P1M'), new \DateTime('......'));
$bitter->getStats('action', $datePeriod);
We have to override DatePeriod to get end date and to add some options.