Created
June 9, 2020 09:09
-
-
Save amandeepmittal/c759baae2aa9b8db8b5de2bb5452c2a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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