Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_findEvents = async (id: string) => {
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
const nextYear = new Date();
nextYear.setFullYear(nextYear.getFullYear() + 1);
const events = await Calendar.getEventsAsync([id], yesterday, nextYear);
this.setState({ events });
}