Save Event to Calender Android with React Native

I want to share how save event to calender default in android, you can see below for example.

Save event android

For save event to calender you can use this repo

Follow to configuration

And add code to trigger(onpress) save event to calender

import AndroidCalendarEvents from 'react-native-calendarevents-android';

AndroidCalendarEvents.addEvent(
{
title: 'Event title',
startDate: Date.now(),
endDate: Date.now() + 3600 * 1000,
description: 'Event description',
location: 'Paris, France'
},
(success) => console.log(success),
(error) => console.log(error)
);

startDate & endDate using milisecond, if you wanna custom date to get milisecond you can follow this code

var fullDate = "10/25/2017 16:00";
var date = new Date(fullDate);
var milliseconds = date.getTime();

Thanks for reading my article, don’t forget to like or follow to get any update from my article.

)

Derry Berni Cahyady

Written by

Data Enthusiast | Web Developer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade