Swat/SwatDateEntry.php
public function setValidRange($start_offset, $end_offset)
    {
        // Beginning of this year
        $date = new SwatDate();
        $date->setMonth(1);
        $date->setDay(1);
        $date->setHour(0);
        $date->setMinute(0);
        $date->setSecond(0);
        $date->setTZById('UTC');

        $this->valid_range_start = clone $date;
        $this->valid_range_end = clone $date;

        $year = $date->getYear();
        $this->valid_range_start->setYear($year + $start_offset);
        $this->valid_range_end->setYear($year + $end_offset + 1);
    }
public function setValidRange($start_offset, $end_offset)
    {
        // Beginning of this year
        $date = new SwatDate();
        $date->setMonth(1);
        $date->setDay(1);
        $date->setHour(0);
        $date->setMinute(0);
        $date->setSecond(0);
        $date->setTZById('UTC');

        $this->valid_range_start = clone $date;
        $this->valid_range_end = clone $date;

        $year = $date->getYear();
        $this->valid_range_start->setYear($year + $start_offset);
        $this->valid_range_end->setYear($year + $end_offset + 1);
    }
public function setValidRange ( $ start_offset , $ end_offset ) { // Beginning of this year $ date = new SwatDate ( ) ; $ date -> setMonth ( 1 ) ; $ date -> setDay ( 1 ) ; $ date -> setHour ( 0 ) ; $ date -> setMinute ( 0 ) ; $ date -> setSecond ( 0 ) ; $ date -> setTZById ( 'UTC' ) ; $ this -> valid_range_start = clone $ date ; $ this -> valid_range_end = clone $ date ; $ year = $ date -> getYear ( ) ; $ this -> valid_range_start -> setYear ( $ year + $ start_offset ) ; $ this -> valid_range_end -> setYear ( $ year + $ end_offset + 1 ) ; }
Set the valid date range

Convenience method to set the valid date range by year offsets.

@param integer $start_offset offset from the current year in years used
to set the starting year of the valid
range.
@param integer $end_offset offset from the current year in years used
to set the ending year of the valid range.
Set the valid date range