A fast and light-weight component library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB

7 years ago
<?php
namespace Twister;
use \DateTime; // http://php.net/manual/en/class.datetime.php
7 years ago
use \DateInterval; // http://php.net/manual/en/class.dateinterval.php
use \DateTimeZone; // http://php.net/manual/en/class.datetimezone.php
use \DatePeriod; // http://php.net/manual/en/class.dateperiod.php
7 years ago
7 years ago
echo 'here 1';
7 years ago
7 years ago
class DatePeriod extends \DatePeriod
7 years ago
{
7 years ago
public static $utc = null;
public static $p1d = null;
7 years ago
7 years ago
public function __construct($start, $interval_spec = null, $end = '9999-12-31')
7 years ago
{
7 years ago
parent::__construct( is_string($start) ? new \DateTime($start, self::$utc) : $start,
$interval_spec === null ? self::$p1d : (is_string($interval_spec) ? new \DateInterval($interval_spec) : $interval_spec),
is_string($end) ? new \DateTime($end, self::$utc) : $end
);
7 years ago
}
public function next()
{
7 years ago
trigger_error('HERE');
$this->current->add($this->interval);
return $this;
7 years ago
}
}
7 years ago
DatePeriod::$utc = new \DateTimeZone('UTC');
DatePeriod::$p1d = new \DateInterval('P1D');