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.
- package/ios/ExpoCalendarKitView.swift +48 -14
- package/package.json +1 -1
|
@@ -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)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|