Esempio n. 1
0
 static function mathPlus2($this1, $period)
 {
     return datetime__DateTime_DateTime_Impl_::add($this1, $period);
 }
Esempio n. 2
0
 static function getWeekDayNum($dt, $weekDay, $num)
 {
     $month = null;
     $days = Std::int(($dt - 62135596800.0 - datetime__DateTime_DateTime_Impl_::yearStart($dt)) / 86400) + 1;
     $month = datetime_utils_DateTimeMonthUtils::getMonth($days, datetime__DateTime_DateTime_Impl_::isLeapYear($dt));
     if ($num > 0) {
         $start = null;
         $time = datetime__DateTime_DateTime_Impl_::monthStart($dt, $month) - 1;
         $start = $time + 62135596800.0;
         $first = datetime__DateTime_DateTime_Impl_::snap($start, datetime_DTSnap::Week(1, $weekDay));
         $this1 = null;
         $period = datetime_DTPeriod::Week($num - 1);
         $this1 = datetime__DateTime_DateTime_Impl_::add($first, $period);
         return $this1 - 62135596800.0;
     } else {
         if ($num < 0) {
             $start1 = null;
             $time1 = datetime__DateTime_DateTime_Impl_::monthStart($dt, $month + 1) - 1;
             $start1 = $time1 + 62135596800.0;
             $first1 = datetime__DateTime_DateTime_Impl_::snap($start1, datetime_DTSnap::Week(-1, $weekDay));
             $this2 = null;
             $period1 = datetime_DTPeriod::Week($num + 1);
             $this2 = datetime__DateTime_DateTime_Impl_::add($first1, $period1);
             return $this2 - 62135596800.0;
         } else {
             return $dt - 62135596800.0;
         }
     }
 }