Library/Bullhorn/FastRest/Api/Services/Date/Date.php
public function getStartOfWeek($offset = null) {
        $dayInWeek = $this->getEpoch();
        if(date('G', $dayInWeek) < 6) {
            $dayInWeek += 60 * 60 * 12; //Offset for daylight savings time
        }
        $week = date('w', $dayInWeek);
        if(is_null($offset)) {
            $offset = $this->getFormatter()->getWeekOffset();
        }
        if($week >= $offset) {
            $day = date('j', $dayInWeek) - date('w', $dayInWeek) + $offset;
        } else { //Go To previous week
            $day = date('j', $dayInWeek) - date('w', $dayInWeek) + $offset - 7;
        }
        return new self(mktime(12, 0, 0, date('n', $dayInWeek), $day, date('Y', $dayInWeek)));
    }
public function getStartOfWeek($offset = null) {
        $dayInWeek = $this->getEpoch();
        if(date('G', $dayInWeek) < 6) {
            $dayInWeek += 60 * 60 * 12; //Offset for daylight savings time
        }
        $week = date('w', $dayInWeek);
        if(is_null($offset)) {
            $offset = $this->getFormatter()->getWeekOffset();
        }
        if($week >= $offset) {
            $day = date('j', $dayInWeek) - date('w', $dayInWeek) + $offset;
        } else { //Go To previous week
            $day = date('j', $dayInWeek) - date('w', $dayInWeek) + $offset - 7;
        }
        return new self(mktime(12, 0, 0, date('n', $dayInWeek), $day, date('Y', $dayInWeek)));
    }
public function getStartOfWeek ( $ offset = null ) { $ dayInWeek = $ this -> getEpoch ( ) ; if ( date ( 'G' , $ dayInWeek ) < 6 ) { $ dayInWeek += 60 * 60 * 12 ; //Offset for daylight savings time } $ week = date ( 'w' , $ dayInWeek ) ; if ( is_null ( $ offset ) ) { $ offset = $ this -> getFormatter ( ) -> getWeekOffset ( ) ; } if ( $ week >= $ offset ) { $ day = date ( 'j' , $ dayInWeek ) - date ( 'w' , $ dayInWeek ) + $ offset ; } else { //Go To previous week $ day = date ( 'j' , $ dayInWeek ) - date ( 'w' , $ dayInWeek ) + $ offset - 7 ; } return new self ( mktime ( 12 , 0 , 0 , date ( 'n' , $ dayInWeek ) , $ day , date ( 'Y' , $ dayInWeek ) ) ) ; }
Gets the first second in a week
@param int|null $offset
@return Date
Gets the first second in a week