Home Display Events from API in FSCalendar
Reply: 0

Display Events from API in FSCalendar

user8372
1#
user8372 Published in September 20, 2018, 4:35 pm

This is my response from api

SUCCESS: { 
  "5": {
  "count": 1,
  "topEvent": false
  },
  "6": {
  "count": 1,
  "topEvent": false
  },
  "7": {
  "count": 3,
  "topEvent": true
  },
  "success": 1
}

In this response i have events in day 5,6 & 7, rest of the days there are no events. Now, I would need to show the count in the center of calendar icon and it should be green when the topEvent is true.

what logic i apply in

func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int {

}

please help me..

share|improve this question
  • first make sure that 5,6,7 must be date not a number. – Khawar Islam Feb 14 at 7:23
  • i already used it basically it takes date parameter – Khawar Islam Feb 14 at 7:31
  • these are 5, 6, 7 days of your current month? you need to form a Date with those days and compare with date provided by the delegate method – Reinier Melian Feb 14 at 7:36
  • i can get current year and month from FSCalendar – Ketan Odedra Feb 14 at 7:40
  • URL: calendar/month/year where, month 1 - 12 year in yyyy Method: GET As i will scroll calendar , it will fetch from server and make set there – Ketan Odedra Feb 14 at 7:42

1 Answer 1

active oldest votes
up vote 1 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.498871 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO