Hey congrats for such a beautiful library. I have 2 arrays as - eventDateArray consisting event NSDates & another array as colouredDateArray having NSDate's to be coloured. How can I achieve the same ? Please reply.
Hi @GABHISEKBUNTY Please download the example and view the 'delegate appearance example'.
For any future users in SWIFT wanting such functionality. Changing colour of particular dates -(take 2 array - prsentStudents - greenColor & absentStudents - redColor)
self.presentDatesArray = ["2016-04-03",
"2016-04-06",
"2016-04-12",
"2016-04-25"];
self.absentDatesArray = ["2016-04-10",
"2016-04-18",
"2016-04-15",
"2016-04-16"];
func calendar(calendar: FSCalendar!, appearance: FSCalendarAppearance!, titleDefaultColorForDate date: NSDate!) -> UIColor!
{
let dateString: String = calendar.stringFromDate(date, format: "yyyy-MM-dd")
if presentDatesArray.containsObject(dateString)
{
return UIColor.greenColor()
}
else if absentDatesArray.containsObject(dateString)
{
return UIColor.redColor()
}
else
{
return nil
}
}
But be sure to implement - FSCalendarDelegateAppearance
馃憤
How to get Month and all Months from calendar?
How to Change particular date color for dates from array get from Json Parsing?
How to Change particular date color for dates from array get from Json Parsing at Calendar launching?
The code is given right above.
how can i do the same task in objective c. green color for present students and redcolor for absent students.
Thanks.
Suppose am getting the dates after a network call, how can I change the fill color of particular dates?
For me calendar.reloadData() is giving me error :
* -[__NSCFCalendar components:fromDate:toDate:options:]: toDate cannot be nil
Future exception.
@anooj1483 Please update to the latest pod. This issue has been fixed
@sandeep34 Bro, I think u can translate the code to obj C. It also works for obj C as well
@GABHISEKBUNTY Hi Abhisek I'm trying to implement your code using swift 3 but its not working . its not showing any error but no effects of colors. I want exactly like your code but the only problem in my case is these attendence are coming from json. please help me through this. thanks abhi in advance :)
@GABHISEKBUNTY @BugFinder27 Hi my problem is same. please share some example and etc.. please help me out of this solution. Thanking you
Hi Team,
My problem is I want to change the selection colour for particular dates and for other dates it can be any
how can I achieve this with this library
Thank you
Any success after json parsing?
You just have to reload the data afer json parsing .. as calendar.reloadData()
Most helpful comment
For any future users in SWIFT wanting such functionality. Changing colour of particular dates -(take 2 array - prsentStudents - greenColor & absentStudents - redColor)
But be sure to implement - FSCalendarDelegateAppearance