expo-calendar-kit 2.1.3 → 2.1.5
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.
|
@@ -193,18 +193,59 @@ public class ExpoCalendarKitView: UIView, DayViewDelegate, EventDataSource {
|
|
|
193
193
|
public func eventsForDate(_ date: Date) -> [EventDescriptor] {
|
|
194
194
|
let calendar = Calendar.current
|
|
195
195
|
print("🔥 eventsForDate called for \(date), have \(events.count) total events")
|
|
196
|
-
|
|
196
|
+
|
|
197
|
+
// HARDCODED EVENTS FOR TESTING - BYPASS BRIDGING ISSUES
|
|
198
|
+
let today = Date()
|
|
199
|
+
|
|
200
|
+
let meeting = calendar.date(bySettingHour: 10, minute: 0, second: 0, of: today) ?? today
|
|
201
|
+
let meetingEnd = calendar.date(bySettingHour: 11, minute: 0, second: 0, of: today) ?? today
|
|
202
|
+
|
|
203
|
+
let lunch = calendar.date(bySettingHour: 12, minute: 0, second: 0, of: today) ?? today
|
|
204
|
+
let lunchEnd = calendar.date(bySettingHour: 13, minute: 0, second: 0, of: today) ?? today
|
|
205
|
+
|
|
206
|
+
let review = calendar.date(bySettingHour: 14, minute: 0, second: 0, of: today) ?? today
|
|
207
|
+
let reviewEnd = calendar.date(bySettingHour: 15, minute: 0, second: 0, of: today) ?? today
|
|
208
|
+
|
|
209
|
+
let hardcodedEvents: [CalendarEvent] = [
|
|
210
|
+
CalendarEvent(from: [
|
|
211
|
+
"id": "hardcoded1",
|
|
212
|
+
"title": "🔥 HARDCODED Meeting",
|
|
213
|
+
"startDate": meeting.timeIntervalSince1970 * 1000,
|
|
214
|
+
"endDate": meetingEnd.timeIntervalSince1970 * 1000,
|
|
215
|
+
"backgroundColor": "#FF0000",
|
|
216
|
+
"color": "#FFFFFF"
|
|
217
|
+
]),
|
|
218
|
+
CalendarEvent(from: [
|
|
219
|
+
"id": "hardcoded2",
|
|
220
|
+
"title": "🔥 HARDCODED Lunch",
|
|
221
|
+
"startDate": lunch.timeIntervalSince1970 * 1000,
|
|
222
|
+
"endDate": lunchEnd.timeIntervalSince1970 * 1000,
|
|
223
|
+
"backgroundColor": "#00FF00",
|
|
224
|
+
"color": "#FFFFFF"
|
|
225
|
+
]),
|
|
226
|
+
CalendarEvent(from: [
|
|
227
|
+
"id": "hardcoded3",
|
|
228
|
+
"title": "🔥 HARDCODED Review",
|
|
229
|
+
"startDate": review.timeIntervalSince1970 * 1000,
|
|
230
|
+
"endDate": reviewEnd.timeIntervalSince1970 * 1000,
|
|
231
|
+
"backgroundColor": "#0000FF",
|
|
232
|
+
"color": "#FFFFFF"
|
|
233
|
+
])
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
print("🔥 Using hardcoded events instead of bridged events")
|
|
237
|
+
let result = hardcodedEvents.compactMap { event in
|
|
197
238
|
let isToday = calendar.isDate(event.startDate, inSameDayAs: date) ||
|
|
198
239
|
calendar.isDate(event.endDate, inSameDayAs: date) ||
|
|
199
240
|
(event.startDate < date && event.endDate > date)
|
|
200
|
-
print("🔥 Event '\(event.title)': \(event.startDate) - \(event.endDate), isToday: \(isToday)")
|
|
241
|
+
print("🔥 Hardcoded Event '\(event.title)': \(event.startDate) - \(event.endDate), isToday: \(isToday)")
|
|
201
242
|
if isToday {
|
|
202
243
|
let ekEvent = event.toEKEvent()
|
|
203
244
|
return EKWrapper(eventKitEvent: ekEvent)
|
|
204
245
|
}
|
|
205
246
|
return nil
|
|
206
247
|
}
|
|
207
|
-
print("🔥 Returning \(result.count) events for date \(date)")
|
|
248
|
+
print("🔥 Returning \(result.count) hardcoded events for date \(date)")
|
|
208
249
|
return result
|
|
209
250
|
}
|
|
210
251
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { requireNativeViewManager } from 'expo-modules-core';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
const NativeView = requireNativeViewManager('
|
|
3
|
+
const NativeView = requireNativeViewManager('ExpoCalendarKit_ExpoCalendarKitView');
|
|
4
4
|
export default function ExpoCalendarKitView(props) {
|
|
5
5
|
const { events, date, style: calendarStyle, onEventPress, onEventLongPress, onTimePress, onTimeLongPress, onDateChanged, scrollToCurrentTime, style, ...otherProps } = props;
|
|
6
6
|
// Convert Date objects to timestamps for native layer
|
|
@@ -5,7 +5,7 @@ import { ViewStyle } from 'react-native';
|
|
|
5
5
|
import { ExpoCalendarKitViewProps } from './ExpoCalendarKit.types';
|
|
6
6
|
|
|
7
7
|
const NativeView: React.ComponentType<ExpoCalendarKitViewProps> =
|
|
8
|
-
requireNativeViewManager('
|
|
8
|
+
requireNativeViewManager('ExpoCalendarKit_ExpoCalendarKitView');
|
|
9
9
|
|
|
10
10
|
export default function ExpoCalendarKitView(props: ExpoCalendarKitViewProps) {
|
|
11
11
|
const {
|