Exemplo n.º 1
0
 public function Alter(Datum $date = null)
 {
     if ($date === null) {
         $date = Datum::ToDay();
     }
     return $date->Year() - $this->Year();
 }
 public static function Now()
 {
     return new Zeitpunkt(Datum::ToDay()->__toString() . " " . Zeit::Now()->__toString());
 }
 public static function AddWorkingDays($days, Datum $date = null)
 {
     if ($date === null) {
         $date = Datum::ToDay();
     }
     if ($days == 0) {
         while (PublicHolidays::IsWeekend($date) || PublicHolidays::IsHoliday($date, new Bundesland('BB', 'Brandenburg'))) {
             $date = $date->DateAdd(1);
         }
     }
     $i = 0;
     while ($i < $days) {
         $date = $date->DateAdd(1);
         if (!PublicHolidays::IsWeekend($date) && !PublicHolidays::IsHoliday($date, new Bundesland('BB', 'Brandenburg'))) {
             $i++;
         }
     }
     return $date;
 }
 public function testToDay()
 {
     $expected = new Datum(date("Y-m-d"));
     $this->assertEquals($expected, Datum::ToDay());
 }