Esempio n. 1
0
 public function testShouldGetLastDayFromGivenMonth()
 {
     $month = new Month(2013, 3);
     $expected = new \DateTime('2013-03-31');
     $result = $month->getLastDay();
     $this->assertEquals($expected, $result);
 }
Esempio n. 2
0
 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);
 }