Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const urlListaHorario = $('#listaHorario').val() + '.json';
  2. new Vue({
  3.     el: '#app',
  4.     data: {
  5.         agendas: [],
  6.         classObject: {
  7.             'red': true,
  8.             'white-text': true
  9.         }
  10.     },
  11.     created: async function() {
  12.         const response = await fetch(urlListaHorario);
  13.         const { agendas } = await response.json();
  14.  
  15.         const all = [
  16.             '06:00', '07:00', '08:00', '09:00',
  17.             '10:00', '11:00', '12:00', '13:00',
  18.             '14:00', '15:00', '16:00', '17:00',
  19.             '18:00', '19:00', '20:00', '21:00'
  20.         ]
  21.  
  22.         agendas.map(numeroSala => {
  23.  
  24.             if(numeroSala.horarioSala !== ['']){
  25.                 isButtonDisabled = true;
  26.             }
  27.  
  28.             numeroSala.horarioSala = all.filter(t => !numeroSala.horarioSala.includes(t)).concat(numeroSala.horarioSala);
  29.             numeroSala.horarioSala.sort();
  30.  
  31.         });
  32.  
  33.         this.agendas = agendas
  34.     }
  35.  
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement