private function setMonth($month) {
        
        //preventing duplication process
        if ($month == $this->month) {
            return;
        }
        $yearToSet  = $this->year;
        $monthToSet = $month;
        
        if ($monthToSet < 1) {
            $monthToSet = abs($monthToSet);
            $yearToSet--;
            
            $yearToSet  -= floor($monthToSet / 12);
            $monthToSet = 12 - ($monthToSet % 12);
            
        } elseif ($monthToSet > 12) {
            $yearToSet  += floor($monthToSet / 12);
            $monthToSet = ($month % 12);
            if ($monthToSet == 0) {
                $monthToSet = 12;
                $yearToSet--;
            }
        }
        
        $this->month = (int) $monthToSet;
        $this->setYear($yearToSet);
    }
private function setMonth($month) {
        
        //preventing duplication process
        if ($month == $this->month) {
            return;
        }
        $yearToSet  = $this->year;
        $monthToSet = $month;
        
        if ($monthToSet < 1) {
            $monthToSet = abs($monthToSet);
            $yearToSet--;
            
            $yearToSet  -= floor($monthToSet / 12);
            $monthToSet = 12 - ($monthToSet % 12);
            
        } elseif ($monthToSet > 12) {
            $yearToSet  += floor($monthToSet / 12);
            $monthToSet = ($month % 12);
            if ($monthToSet == 0) {
                $monthToSet = 12;
                $yearToSet--;
            }
        }
        
        $this->month = (int) $monthToSet;
        $this->setYear($yearToSet);
    }
private function setMonth ( $ month ) { //preventing duplication process if ( $ month == $ this -> month ) { return ; } $ yearToSet = $ this -> year ; $ monthToSet = $ month ; if ( $ monthToSet < 1 ) { $ monthToSet = abs ( $ monthToSet ) ; $ yearToSet -- ; $ yearToSet -= floor ( $ monthToSet / 12 ) ; $ monthToSet = 12 - ( $ monthToSet % 12 ) ; } elseif ( $ monthToSet > 12 ) { $ yearToSet += floor ( $ monthToSet / 12 ) ; $ monthToSet = ( $ month % 12 ) ; if ( $ monthToSet == 0 ) { $ monthToSet = 12 ; $ yearToSet -- ; } } $ this -> month = ( int ) $ monthToSet ; $ this -> setYear ( $ yearToSet ) ; }
Update month in jalali date

@param int $month
Update month in jalali date