Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const urlListaHorario = $('#listaHorario').val() + '.json';
- new Vue({
- el: '#app',
- data: {
- agendas: [],
- agendasOriginal: [],
- classObject: {
- 'red': true,
- 'white-text': true,
- },
- },
- created: async function() {
- const response = await fetch(urlListaHorario);
- const { agendas } = await response.json();
- const { agendasOriginal } = this.agendas;
- const all = [
- '06:00', '07:00', '08:00', '09:00',
- '10:00', '11:00', '12:00', '13:00',
- '14:00', '15:00', '16:00', '17:00',
- '18:00', '19:00', '20:00', '21:00'
- ];
- const allSalas = [
- 'Sala 01', 'Sala 02',
- 'Sala 03', 'Sala 04',
- 'Sala 05', 'Sala 06'
- ];
- agendas.map(idSala => {
- idSala.horarioSala = all.filter(t => !idSala.horarioSala.includes(t)).concat(idSala.horarioSala);
- idSala.horarioSala.sort();
- });
- this.agendas = agendas
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement