expo-calendar-kit 2.1.5 → 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.
- package/ios/ExpoCalendarKitView.swift +42 -49
- package/package.json +1 -1
|
@@ -192,61 +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)
|
|
195
|
+
print("🔥 eventsForDate called for \(date)")
|
|
196
196
|
|
|
197
|
-
// HARDCODED EVENTS FOR TESTING -
|
|
197
|
+
// HARDCODED EVENTS FOR TESTING - Following CalendarKit docs exactly
|
|
198
198
|
let today = Date()
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
|
|
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
|
+
}
|
|
202
205
|
|
|
203
|
-
|
|
204
|
-
let lunchEnd = calendar.date(bySettingHour: 13, minute: 0, second: 0, of: today) ?? today
|
|
206
|
+
print("🔥 Creating hardcoded events for today")
|
|
205
207
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
// Create events using CalendarKit's Event class (EventDescriptor)
|
|
209
|
+
var events = [Event]()
|
|
208
210
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
print("🔥 Hardcoded Event '\(event.title)': \(event.startDate) - \(event.endDate), isToday: \(isToday)")
|
|
242
|
-
if isToday {
|
|
243
|
-
let ekEvent = event.toEKEvent()
|
|
244
|
-
return EKWrapper(eventKitEvent: ekEvent)
|
|
245
|
-
}
|
|
246
|
-
return nil
|
|
247
|
-
}
|
|
248
|
-
print("🔥 Returning \(result.count) hardcoded events for date \(date)")
|
|
249
|
-
return result
|
|
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
|
|
250
243
|
}
|
|
251
244
|
|
|
252
245
|
// MARK: - DayViewDelegate
|