expo-calendar-kit 2.1.4 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -192,20 +192,54 @@ public class ExpoCalendarKitView: UIView, DayViewDelegate, EventDataSource {
192
192
  // MARK: - EventDataSource
193
193
  public func eventsForDate(_ date: Date) -> [EventDescriptor] {
194
194
  let calendar = Calendar.current
195
- print("🔥 eventsForDate called for \(date), have \(events.count) total events")
196
- let result = events.compactMap { event in
197
- let isToday = calendar.isDate(event.startDate, inSameDayAs: date) ||
198
- calendar.isDate(event.endDate, inSameDayAs: date) ||
199
- (event.startDate < date && event.endDate > date)
200
- print("🔥 Event '\(event.title)': \(event.startDate) - \(event.endDate), isToday: \(isToday)")
201
- if isToday {
202
- let ekEvent = event.toEKEvent()
203
- return EKWrapper(eventKitEvent: ekEvent)
204
- }
205
- return nil
206
- }
207
- print("🔥 Returning \(result.count) events for date \(date)")
208
- return result
195
+ print("🔥 eventsForDate called for \(date)")
196
+
197
+ // HARDCODED EVENTS FOR TESTING - Following CalendarKit docs exactly
198
+ let today = Date()
199
+
200
+ // Check if the requested date is today
201
+ guard calendar.isDate(date, inSameDayAs: today) else {
202
+ print("🔥 Not today, returning empty events")
203
+ return []
204
+ }
205
+
206
+ print("🔥 Creating hardcoded events for today")
207
+
208
+ // Create events using CalendarKit's Event class (EventDescriptor)
209
+ var events = [Event]()
210
+
211
+ // Event 1: Meeting
212
+ let meeting = Event()
213
+ let meetingStart = calendar.date(bySettingHour: 10, minute: 0, second: 0, of: today) ?? today
214
+ let meetingEnd = calendar.date(bySettingHour: 11, minute: 0, second: 0, of: today) ?? today
215
+ meeting.dateInterval = DateInterval(start: meetingStart, end: meetingEnd)
216
+ meeting.text = "🔥 HARDCODED Meeting\nConference Room A\n10:00 - 11:00"
217
+ meeting.color = UIColor.white
218
+ meeting.backgroundColor = UIColor.red
219
+ events.append(meeting)
220
+
221
+ // Event 2: Lunch
222
+ let lunch = Event()
223
+ let lunchStart = calendar.date(bySettingHour: 12, minute: 0, second: 0, of: today) ?? today
224
+ let lunchEnd = calendar.date(bySettingHour: 13, minute: 0, second: 0, of: today) ?? today
225
+ lunch.dateInterval = DateInterval(start: lunchStart, end: lunchEnd)
226
+ lunch.text = "🔥 HARDCODED Lunch\nCafeteria\n12:00 - 13:00"
227
+ lunch.color = UIColor.white
228
+ lunch.backgroundColor = UIColor.green
229
+ events.append(lunch)
230
+
231
+ // Event 3: Review
232
+ let review = Event()
233
+ let reviewStart = calendar.date(bySettingHour: 14, minute: 0, second: 0, of: today) ?? today
234
+ let reviewEnd = calendar.date(bySettingHour: 15, minute: 0, second: 0, of: today) ?? today
235
+ review.dateInterval = DateInterval(start: reviewStart, end: reviewEnd)
236
+ review.text = "🔥 HARDCODED Review\nMeeting Room B\n14:00 - 15:00"
237
+ review.color = UIColor.white
238
+ review.backgroundColor = UIColor.blue
239
+ events.append(review)
240
+
241
+ print("🔥 Returning \(events.count) hardcoded events for today")
242
+ return events
209
243
  }
210
244
 
211
245
  // MARK: - DayViewDelegate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-calendar-kit",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "Expo module wrapping the native Swift CalendarKit library for React Native apps",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",