FrontEndDev #4

Merged
onsaliyo merged 17 commits from FrontEndDev into master 2021-05-14 15:45:24 +02:00
1 changed files with 6 additions and 17 deletions
Showing only changes of commit 427398154b - Show all commits

View File

@ -37,20 +37,7 @@ export class PromptEventoPage implements OnInit{
onSubmit(){ onSubmit(){
this.submitted = true; this.submitted = true;
if (this.eventoForm.valid){ if (this.eventoForm.valid){
let evento: Eventoi = { this.asignarEvento(this.tab1Service.eventos[this.tab1Service.eventoIndex]);
id: null,
discotecaID: this.tab1Service.discotecaI.discotecaID,
nombre: '',
localizacion: this.tab1Service.discotecaI.localizacion,
fecha: null,
hora: null,
descripcion: '',
precio1: null,
precio2: null
};
this.asignarEvento(evento);
} }
} }
asignarEvento(evento: Eventoi){ asignarEvento(evento: Eventoi){
@ -59,14 +46,16 @@ export class PromptEventoPage implements OnInit{
var fecha = this.eventoForm.get('fecha').value; var fecha = this.eventoForm.get('fecha').value;
fecha = fecha.split("T")[0]; fecha = fecha.split("T")[0];
evento.fecha = fecha; evento.fecha = fecha;
let hora = this.eventoForm.get('hora').value; var hora = this.eventoForm.get('hora').value;
hora = hora.split("T")[1]; if (!this.tab1Service.editarEvento){
hora = hora.split("T")[1];}
hora = hora.split(":")[0]+(":")+hora.split(":")[1]; hora = hora.split(":")[0]+(":")+hora.split(":")[1];
console.log(hora);
evento.hora = hora; evento.hora = hora;
evento.precio1 = this.eventoForm.get('precio1').value; evento.precio1 = this.eventoForm.get('precio1').value;
evento.precio2 = this.eventoForm.get('precio2').value; evento.precio2 = this.eventoForm.get('precio2').value;
if (!this.tab1Service.eventos){ if (!this.tab1Service.eventos){
this.tab1Service.initEventos();} this.tab1Service.eventos=[];}
if(!this.tab1Service.eventoForms){ if(!this.tab1Service.eventoForms){
this.tab1Service.initEventoForms();} this.tab1Service.initEventoForms();}
this.tab1Service.postEvento(evento); this.tab1Service.postEvento(evento);