Using a calendar from React-Native Calendars, I just want to be able to pass the date (maybe as a dateString) into a function when a day is pressed.
Here is my code:
import React, {Component} from 'react';
import {View, Text, Button, ScrollView} from 'react-native';
import colors from '../config/colors';
import { TextInput } from '../components/TextInput';
import { Calendar } from 'react-native-calendars';
class SetReservation extends Component {
showDayTest(date) {
alert(date);
}
render() {
return (
<View>
<Calendar
onDayPress={(dateString) => this.showDayTest(dateString)}
/>
</View>
);
}
}
export default SetReservation;
For now, I just want it to alert a dateString in this test function when a day is pressed, so I know I can use it to do what I want. Here is what is happening: