root/trunk/src/main/php/net/stubbles/util/datespan/stubDateSpanWeek.php

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  * Datespan that represents a week.
4  *
5  * @author      Ingo Sobolewski <ingo.sobolewski@1und1.de>
6  * @author      Frank Kleine <frank.kleine@1und1.de>
7  * @package     stubbles
8  * @subpackage  util_datespan
9  */
10 stubClassLoader::load('net::stubbles::util::datespan::stubDateSpanCustom');
11 /**
12  * Datespan that represents a week.
13  *
14  * @package     stubbles
15  * @subpackage  util_datespan
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 ?>
Note: See TracBrowser for help on using the browser.