             }
             }) { (value: Bool) in
                 self.removeCalendarButtonObject()
-                
-                if barposition > 0 {
-                    self.setupNextCalendarData()
-                }else {
-                    self.setupPrevCalendarData()
-                }
                 self.generateCalendar()
-                self.setupCalendarTitleLabel()
         }
     }
 

    
    //タイトル表記を設定する関数
    func setupCalendarTitleLabel() {
        calendarBar.text = String("\(year)年\(month)月")
        calendarBar.textAlignment = NSTextAlignment.Center
        calendarBar.textColor = UIColor.whiteColor()
        

        let prevX = (15+50*(41%7)+60)
        let mainX = (15+50*(41%7)+60)
        let nextX = 15

        self.setupNextCalendarData()
        Animationcalendar(-prevX, mainIntervalX: -mainX, nextIntervalX: nextX, barposition: 20)
        self.setupCalendarTitleLabel()
        AnimationcalendarBar(20)
    }
    
