12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import React, { Component } from 'react';
- import {StyleSheet,View} from 'react-native';
- import CalendarPicker from 'react-native-calendar-picker';
-
-
- export default class Calendario extends Component {
- constructor(props) {
- super(props);
- this.state = {
- selectedStartDate: null,
- interpreter_id : this.props.route.params.Intereprete_id,
- mapflag : this.props.route.params.Flag,
- };
- this.onDateChange = this.onDateChange.bind(this);
-
- }
-
- onDateChange(date) {
- this.setState({
- selectedStartDate: date,
- });
- console.log(date)
- console.log(this.props.route.params.Flag)
-
- if(this.state.mapflag == false){
- this.props.navigation.navigate('StateTime', {Appointment_Date: date._d, int_id : this.state.interpreter_id, Flag: this.state.mapflag});
- }
- else{
- this.props.navigation.navigate('Map', {Appointment_Date: date._d, int_id : this.state.interpreter_id, Flag: this.state.mapflag});
- }
- }
-
- render() {
- const { selectedStartDate } = this.state;
- const today = new Date();
- console.log(today)
- const appointment = selectedStartDate ? selectedStartDate.toString() : '';
- console.log(this.props.route.params)
- return (
- <View style = {styles.container}>
- <CalendarPicker
- minDate={today}
- onDateChange={this.onDateChange}
- selectionMode="singleDay"
- scrollMode="oneMonth"
- monthsAfter={24}
-
- />
-
- </View>
- );
- }
- }
-
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: '#FFFFFF',
- marginTop: 100,
- },
- });
|