|
Revision 1230, 1.0 kB
(checked in by mikey, 6 months ago)
|
continued refactoring #119: replaced package dots in net::stubbles::util
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
stubClassLoader::load('net::stubbles::util::datespan::stubDateSpanCustom'); |
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
class stubDateSpanWeek extends stubDateSpanCustom implements stubDateSpan |
|---|
| 18 |
{ |
|---|
| 19 |
|
|---|
| 20 |
* constructor |
|---|
| 21 |
* |
|---|
| 22 |
* @param string|DateTime $date start date of the week |
|---|
| 23 |
* @param string $interval optional interval of the span |
|---|
| 24 |
*/ |
|---|
| 25 |
public function __construct($date, $interval = stubDateSpan::INTERVAL_DAY) |
|---|
| 26 |
{ |
|---|
| 27 |
if (($date instanceof DateTime) == false) { |
|---|
| 28 |
$date = new DateTime($date); |
|---|
| 29 |
} |
|---|
| 30 |
|
|---|
| 31 |
$end = clone $date; |
|---|
| 32 |
$end->modify('+ 6 days'); |
|---|
| 33 |
parent::__construct($date, $end, $interval); |
|---|
| 34 |
} |
|---|
| 35 |
} |
|---|
| 36 |
?> |
|---|