unixzii / Daysquare

📆 An elegant calendar control for iOS.
MIT License
703 stars 75 forks source link

How to solve the error Invalid Month 0 #9

Open gopalsunkpo opened 6 years ago

gopalsunkpo commented 6 years ago

{ super.viewDidLoad()

    calendarFromDateArr2 =  ["2017-11-05T07:41:00", "2017-10-30T11:23:00", "2017-10-30T11:48:00", "2017-11-10T00:00:00", "2017-11-13T19:43:00", "2017-12-01T00:00:00", "2017-12-31T00:00:00"]

    for calendardate in calendarFromDateArr2

    {

        print("date :\(calendardate)")

        let dateFormatter = DateFormatter()

        dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
        dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss"

        let date = dateFormatter.date(from: calendardate)

        print(date)

        self.calendarView.selectedDate = date

        //return

    }

}
unixzii commented 6 years ago

Could you tell me your OS version and any logs printed of this issue?