Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Add a class to get count for an Event by month or week or day #13

Open
jeremyFreeAgent opened this issue Jan 8, 2013 · 1 comment
Open
Milestone

Comments

@jeremyFreeAgent
Copy link
Owner

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";
}
@stephpy
Copy link
Contributor

stephpy commented Jan 8, 2013

$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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants