Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created June 9, 2020 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/c759baae2aa9b8db8b5de2bb5452c2a1 to your computer and use it in GitHub Desktop.
Save amandeepmittal/c759baae2aa9b8db8b5de2bb5452c2a1 to your computer and use it in GitHub Desktop.
export default function App() {
const [eventTitle, setEventTitle] = useState('Default event');
return (
<View style={styles.container}>
<Text style={styles.title}>
Add Event in device's Calendar from React Native App
</Text>
<View style={styles.inputContainer}>
<Text style={styles.text}>Enter the Event title:</Text>
<TextInput
style={styles.input}
value={eventTitle}
onChangeText={text => setEventTitle(text)}
/>
<Text style={styles.text}>Current Date and Time of the event:</Text>
<Text style={styles.text}>
{moment
.utc(TIME_NOW_IN_UTC)
.local()
.format('lll')}
</Text>
</View>
<TouchableOpacity style={styles.button}>
<Text style={[styles.text, { color: 'white' }]}>
Add this event to the calendar
</Text>
</TouchableOpacity>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment