public function testShouldGetFirstDayFromGivenMonth() { $month = new Month(2013, 3); $expected = new \DateTime('2013-03-01'); $result = $month->getFirstDay(); $this->assertEquals($expected, $result); }
public function fetchMonth(\InFog\SimpleFinance\Types\Month $month) { /** * TODO There is a bug in \Respect\Relational when using >= and <= on the same column * https://github.com/Respect/Relational/issues/35 * I'll remove this weird $key when it gets fixed */ $key = 'date >= "' . $month->getFirstDay()->format('Y-m-d 00:00:00') . '" AND date <='; $conditions = array($key => $month->getLastDay()->format('Y-m-d 23:59:59')); return $this->fetchConditions($conditions); }