Exemple #1
0
 public function testNDOWLast()
 {
     /* ignoreNDOW */
     $in = new Carbon('2015-05-24');
     /* Day before - NBD should skip 25th */
     $c = new Calculator();
     $c->addCallback(CB::ignoreNDOW(5, -1, 1));
     $this->assertEquals('2015-05-26', $c->nbd($in)->format('Y-m-d'));
 }
 public function testIgnoreDaysOfMonth()
 {
     $cb = C::ignoreDaysOfMonth(array(1, 6));
     $dt = new Carbon('2014-01-02');
     $this->assertFalse($cb($dt));
     $dt = new Carbon('2014-01-01');
     $this->assertTrue($cb($dt));
     $dt = new Carbon('2014-01-06');
     $this->assertTrue($cb($dt));
 }