Save Event to Calender Android with React Native

Derry Berni Cahyady
1 min readAug 22, 2017

--

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
Derry Berni Cahyady

Written by Derry Berni Cahyady

Data & Security Enthusiast | Software Engineer

No responses yet