12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import React, { Component } from 'react';
- import {
- StyleSheet,
- Text,
- View
- } from 'react-native';
- //import CalendarPicker from 'react-native-calendar-picker';
- import {Calendar, CalendarList} from 'react-native-calendars';
-
-
- export default class Calendario extends Component {
- constructor(props) {
- super(props);
- this.state = {
- selectedStartDate: null,
- interpreter_id : this.props.route.params.Intereprete_id,
- };
- this.onDayPress = this.onDayPress.bind(this);
-
- }
-
- onDayPress(date) {
- this.setState({
- selectedStartDate: date,
- });
-
- this.props.navigation.navigate('StateTime', {Appointment_Date: date, int_id : this.state.interpreter_id});
- }
-
- render() {
- const { selectedStartDate } = this.state;
- const today = new Date();
- const appointment = selectedStartDate ? selectedStartDate.toString() : '';
- console.log(this.props.route.params)
- return (
- <View style={styles.container}>
- <Calendar
- onVisibleMonthsChange={(months) => {console.log('now these months are visible', months);}}
- minDate={today}
- onDayPress={this.onDayPress}
- />
- </View>
- );
- }
- }
-
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: '#FFFFFF',
- marginTop: 100,
- },
- });
-
-
|