this() public method

public this ( $pointer = 'future' )
示例#1
0
文件: Second.php 项目: horde/horde
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     $end = clone $this->now;
     $end->sec++;
     return new Horde_Date_Span($this->now, $end);
 }
示例#2
0
文件: Week.php 项目: jubinpatel/horde
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'future':
             $thisWeekStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour + 1));
             $sundayRepeater = new Horde_Date_Repeater_DayName('sunday');
             $sundayRepeater->now = $this->now;
             $thisSundaySpan = $sundayRepeater->this('future');
             $thisWeekEnd = $thisSundaySpan->begin;
             return new Horde_Date_Span($thisWeekStart, $thisWeekEnd);
         case 'past':
             $thisWeekEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour));
             $sundayRepeater = new Horde_Date_Repeater_DayName('sunday');
             $sundayRepeater->now = $this->now;
             $lastSundaySpan = $sundayRepeater->next('past');
             $thisWeekStart = $lastSundaySpan->begin;
             return new Horde_Date_Span($thisWeekStart, $thisWeekEnd);
         case 'none':
             $sundayRepeater = new Horde_Date_Repeater_DayName('sunday');
             $sundayRepeater->now = $this->now;
             $lastSundaySpan = $sundayRepeater->next('past');
             $thisWeekStart = $lastSundaySpan->begin;
             $thisWeekEnd = clone $thisWeekStart;
             $thisWeekEnd->day += 7;
             return new Horde_Date_Span($thisWeekStart, $thisWeekEnd);
     }
 }
示例#3
0
文件: MonthName.php 项目: horde/horde
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'past':
             return $this->next($pointer);
         case 'future':
         case 'none':
             return $this->next('none');
     }
 }
示例#4
0
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'future':
         case 'none':
             $saturdayRepeater = new Horde_Date_Repeater_DayName('saturday');
             $saturdayRepeater->now = $this->now;
             $thisSaturdaySpan = $saturdayRepeater->this('future');
             return new Horde_Date_Span($thisSaturdaySpan->begin, $thisSaturdaySpan->begin->add(array('day' => 2)));
         case 'past':
             $saturdayRepeater = new Horde_Date_Repeater_DayName('saturday');
             $saturdayRepeater->now = $this->now;
             $lastSaturdaySpan = $saturdayRepeater->this('past');
             return new Horde_Date_Span($lastSaturdaySpan->begin, $lastSaturdaySpan->begin->add(array('day' => 2)));
     }
 }
示例#5
0
文件: Year.php 项目: raz0rsdge/horde
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'future':
             $thisYearStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day + 1));
             $thisYearEnd = new Horde_Date(array('year' => $this->now->year + 1, 'month' => 1, 'day' => 1));
             break;
         case 'past':
             $thisYearStart = new Horde_Date(array('year' => $this->now->year, 'month' => 1, 'day' => 1));
             $thisYearEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day));
             break;
         case 'none':
             $thisYearStart = new Horde_Date(array('year' => $this->now->year, 'month' => 1, 'day' => 1));
             $thisYearEnd = new Horde_Date(array('year' => $this->now->year + 1, 'month' => 1, 'day' => 1));
             break;
     }
     return new Horde_Date_Span($thisYearStart, $thisYearEnd);
 }
示例#6
0
文件: Day.php 项目: raz0rsdge/horde
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'future':
             $dayBegin = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour + 1));
             $dayEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day + 1));
             break;
         case 'past':
             $dayBegin = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day));
             $dayEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour));
             break;
         case 'none':
             $dayBegin = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day));
             $dayEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day + 1));
             break;
     }
     return new Horde_Date_Span($dayBegin, $dayEnd);
 }
示例#7
0
文件: Hour.php 项目: horde/horde
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'future':
             $hourStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour, 'min' => $this->now->min + 1));
             $hourEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour + 1));
             break;
         case 'past':
             $hourStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour));
             $hourEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour, 'min' => $this->now->min));
             break;
         case 'none':
             $hourStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour));
             $hourEnd = $hourStart->add(array('hour' => 1));
             break;
     }
     return new Horde_Date_Span($hourStart, $hourEnd);
 }
示例#8
0
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'future':
             $minuteBegin = clone $this->now;
             $minuteEnd = new Horde_Date(array('month' => $this->now->month, 'year' => $this->now->year, 'day' => $this->now->day, 'hour' => $this->now->hour, 'min' => $this->now->min));
             break;
         case 'past':
             $minuteBegin = new Horde_Date(array('month' => $this->now->month, 'year' => $this->now->year, 'day' => $this->now->day, 'hour' => $this->now->hour, 'min' => $this->now->min));
             $minuteEnd = clone $this->now;
             break;
         case 'none':
             $minuteBegin = new Horde_Date(array('month' => $this->now->month, 'year' => $this->now->year, 'day' => $this->now->day, 'hour' => $this->now->hour, 'min' => $this->now->min));
             $minuteEnd = new Horde_Date(array('month' => $this->now->month, 'year' => $this->now->year, 'day' => $this->now->day, 'hour' => $this->now->hour, 'min' => $this->now->min + 1));
             break;
     }
     return new Horde_Date_Span($minuteBegin, $minuteEnd);
 }
示例#9
0
文件: Time.php 项目: horde/horde
 public function this($context = 'future')
 {
     parent::this($context);
     if ($context == 'none') {
         $context = 'future';
     }
     return $this->next($context);
 }
示例#10
0
 public function this($context = 'future')
 {
     parent::this($context);
     $rangeStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'sec' => $this->range[0]));
     $this->currentSpan = new Horde_Date_Span($rangeStart, $rangeStart->add($this->range[1] - $this->range[0]));
     return $this->currentSpan;
 }
示例#11
0
文件: Season.php 项目: horde/horde
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     throw new Horde_Date_Repeater_Exception('Not implemented');
 }