ErnestoOrtiz2 před 2 roky
rodič
revize
a2b14efe32
2 změnil soubory, kde provedl 9 přidání a 3 odebrání
  1. 1
    1
      screens/main/Calendar.js
  2. 8
    2
      screens/main/StateTime.js

+ 1
- 1
screens/main/Calendar.js Zobrazit soubor

@@ -27,7 +27,7 @@ export default class Calendario extends Component {
27 27
     console.log(this.props.route.params.Flag)
28 28
     
29 29
     if(this.state.mapflag == false){
30
-      this.props.navigation.navigate('StateTime', {Appointment_Date: date._d, int_id : this.state.interpreter_id, 
30
+      this.props.navigation.navigate('StateTime', {Appointment: date._d, int_id : this.state.interpreter_id, 
31 31
         Flag: this.state.mapflag, I_Token: this.state.i_token, U_Token: this.state.u_token
32 32
         ,Username: this.state.username, I_Username: this.state.I_username});
33 33
     }

+ 8
- 2
screens/main/StateTime.js Zobrazit soubor

@@ -165,12 +165,14 @@ export default class Time extends Component{
165 165
   else{
166 166
     const user = firebase.auth().currentUser
167 167
     const uid = user.uid
168
+    const username = this.state.username;
169
+    const I_username = this.state.I_username;
168 170
     const u_token = this.state.u_token;
169 171
     const i_token = this.state.i_token;
170 172
     const date = this.state.Appointment
171
-    const month = date.getMonth();
173
+    const month = date.getMonth() + 1;
174
+    console.log("Month: ", month)
172 175
     const day = date.getDate();
173
-    console.log("Date: ", day)
174 176
     const _time_ = selectedTime;
175 177
     const i_id = this.state.int2_id;
176 178
     console.log('Params: ')
@@ -178,6 +180,8 @@ export default class Time extends Component{
178 180
     firebase.firestore()
179 181
     .collection('APPOINTMENTS')
180 182
     .add({ 
183
+      User: username,
184
+      Interpreter: I_username,
181 185
       participantes: [
182 186
       i_id,
183 187
       uid, 
@@ -214,3 +218,5 @@ export default class Time extends Component{
214 218
     );
215 219
   }
216 220
 }
221
+
222
+