App crashes using save event on android
See original GitHub issueusing the method saveEvent
close the application, I have a notificationService
wrapping the saveEvent
method and passing a date with the format YYYY-mm-DD
crashed the application
Environment
System: OS: macOS 10.15.7 CPU: (4) x64 Intel® Core™ i5-7267U CPU @ 3.10GHz Memory: 442.09 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node Yarn: 1.22.4 - ~/.nvm/versions/node/v14.3.0/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Not Found Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.2, 29.0.3 System Images: android-28 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: /undefined - /usr/bin/xcodebuild Languages: Java: 1.8.0_275 - /usr/bin/javac Python: 3.8.5 - /opt/anaconda3/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to Reproduce
const createEvent = async () => {
var startDateUTC = '2021-01-31T14:00:00.000Z';
const event = {
title: 'my first event',
startDate: moment(startDateUTC).subtract(1, 'hours').toISOString(),
endDate: moment(startDateUTC).toISOString(),
};
const calendar = calendars.pop();
console.log(calendar);
const result = await calendarService.addCalendarEvent(event, calendar);
}
return (
<>
<Appbar>
<Appbar.Action
icon="archive"
onPress={() => console.log('Pressed archive')}
/>
<Appbar.Action icon="mail" onPress={() => console.log('Pressed mail')} />
<Appbar.Action icon="label" onPress={async () => await createEvent()} />
<Appbar.Action
icon="delete"
onPress={() => notificationService.scheduleNotification({ title: "hello", message: "its me andy", date: new Date(Date.now() + 60 * 1000) })}
/>
</Appbar>
<ProcessPage />
</>
);
Expected Behavior
should save the event
Actual Behavior
the app crash and is forced to stop
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top GitHub Comments
Can you try passing timestamp instead of ISOstring for dates?
removing the attendees property and making the id integer string stops the crashing for me