         }
     }
 
-    func isselectedDayinWeek(date: Date) -> Bool {
+    func isselectedDayinWeek(_ date: Date) -> Bool {
         return self.day!.rawValue == date.getWeekday()
     }
 

        return false
    }

    func islastSelectedDayinMonth(date: Date) -> Bool {
        if date.isSelectedDayofWeek(day: self.day!) && date.daymonth() > 24 {
            return true
        } else {

    func keepallorlastdayinweek(index: Int) -> Bool {
        var check: Keepallorlastdayinweekfunc?
        if self.keepallselcteddayofweek {
            check = self.isselectedDayinWeek
        } else {
            check = self.islastSelectedDayinMonth
        }
