     var number = 6
     
     let TEST = "aaa"
-    
+    var monthdaycounts = 0
     
     //ワンクール分のシフトをShiftDetailDBとShiftDBへ記録する
     func ShiftDBOneCoursRegist(importname: String, importpath: String, update: Bool){
+        let shiftyearandmonth = self.JudgeYearAndMonth()
+        let shiftnsdate = MonthlySalaryShow().DateSerial(MonthlySalaryShow().Changecalendar(shiftyearandmonth.year, calender: "JP"), month: shiftyearandmonth.startcoursmonth, day: 1)
+        let c = NSCalendar.currentCalendar()
+        let monthrange = c.rangeOfUnit([NSCalendarUnit.Day],  inUnit: [NSCalendarUnit.Month], forDate: shiftnsdate)
+        monthdaycounts = monthrange.length
         
         let documentPath: String = NSBundle.mainBundle().pathForResource(TEST, ofType: "xlsx")!
         let spreadsheet: BRAOfficeDocumentPackage = BRAOfficeDocumentPackage.open(documentPath)

                    shiftdetaildb.month = JudgeYearAndMonth().startcoursmonth
                    date++
                    
                    if(date > 30){
                        date = 1
                        flag = 1
                    }

    }
    
    //返り値は
    //年(和暦)、11日〜月末までの月、1日〜10日までの月
    func JudgeYearAndMonth() -> (year: Int, startcoursmonth: Int, endcoursmonth: Int){
        
        let documentPath: String = NSBundle.mainBundle().pathForResource(TEST, ofType: "xlsx")!
