public function testDays() { $ci = new Interval(0, 0, 0, 1); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 1, 0, 0, 0); $ci = Interval::days(2); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 2, 0, 0, 0); $ci = Interval::dayz(2); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 2, 0, 0, 0); $ci = Interval::day(); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 1, 0, 0, 0); $ci = Interval::day(3); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 3, 0, 0, 0); }
/** * Get the difference in days using a filter closure. * * @param Closure $callback * @param Date|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInDaysFiltered(Closure $callback, Date $dt = null, $abs = true) { return $this->diffFiltered(Interval::day(), $callback, $dt, $abs); }