<commit_before><template>
 <div>
    <div class="center">
      <h4 class="center">Disciplinas Agendadas</h4>
      <br>
      <table>
        <thead>
          <tr>
              <th>Disciplina</th>
              <th>Unidade</th>
              <th>Data</th>
              <th>Horário</th>
              <th>Sala</th>
          </tr>
        </thead>

        <tbody>
          <tr v-for="user in usuario">
            <td>{{user.disciplinaAgendada}}</td>
            <td>{{user.unidadeAgendada}}</td>
            <td>{{user.dataAgendada | dataFormatada}}</td>
            <td>{{user.dataAgendada | horarioFormatado}}
            <td>{{user.salaAgendada}}</td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <a class="btn-floating btn-large red darken-4" id="btnImprimir" @click="imprimir()">
        <i class="large material-icons">local_printshop</i>
      </a>
    </div>
</div>
</template>

<script>
  import {Dados} from './CadastrarComponents/Dados.js'
  import moment from 'moment';
  import {firebase} from '../Firebase'
  let firebaseDatabase = firebase.database();
  //não é o modo mais correto de se pegar o UID do usuário, mas com a função do firebase fica retornando nulo
  let usuarioUid = JSON.parse(localStorage.getItem('firebase:authUser:<KEY>:[DEFAULT]'));
  let usuarioRef = '';
  if (usuarioUid) {
    usuarioUid = usuarioUid.uid;
    usuarioRef = firebaseDatabase.ref('usuarios').child(usuarioUid).child('disciplinasAgendadas');
  }
  export default {
    name: 'impressao',
    firebase: {
      usuario: usuarioRef
    },
    beforeCreate: function() {
      firebase.auth().onAuthStateChanged(function(user){
       if (!user) {
         window.location.href = "/"
       } else if(user.displayName == "adm") {
          window.location.href = "/cadastrar";
        }
      })
    },
    methods: {
      imprimir: function() {
        $("#btnImprimir").hide();
        window.print();
        $("#btnImprimir").show();
      }
    },
    filters: {
      dataFormatada: function (data) {
        var dataParse = JSON.parse(data + '000')
        return moment(dataParse).format('DD/MM/YYYY')
      },
      horarioFormatado: function (data) {
        var dataParse = JSON.parse(data + '000')
        return moment(dataParse).format('hh:mm')
      },
    }
  };
</script>

<commit_msg>atualizado o moment na página de impressão<commit_after><template>
 <div>
    <div class="center">
      <h4 class="center">Disciplinas Agendadas</h4>
      <br>
      <table>
        <thead>
          <tr>
              <th>Disciplina</th>
              <th>Unidade</th>
              <th>Data</th>
              <th>Horário</th>
              <th>Sala</th>
          </tr>
        </thead>

        <tbody>
          <tr v-for="user in usuario">
            <td>{{user.disciplinaAgendada}}</td>
            <td>{{user.unidadeAgendada}}</td>
            <td>{{user.dataAgendada | dataFormatada}}</td>
            <td>{{user.dataAgendada | horarioFormatado}}
            <td>{{user.salaAgendada}}</td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <a class="btn-floating btn-large red darken-4" id="btnImprimir" @click="imprimir()">
        <i class="large material-icons">local_printshop</i>
      </a>
    </div>
</div>
</template>

<script>
  import {Dados} from './CadastrarComponents/Dados.js'
  import moment from 'moment';
  import {firebase} from '../Firebase'
  let firebaseDatabase = firebase.database();
  //não é o modo mais correto de se pegar o UID do usuário, mas com a função do firebase fica retornando nulo
  let usuarioUid = JSON.parse(localStorage.getItem('firebase:authUser:AIzaSyCGdLFWep-fuAlpc9RterbDSPxtn0SEIHU:[DEFAULT]'));
  let usuarioRef = '';
  if (usuarioUid) {
    usuarioUid = usuarioUid.uid;
    usuarioRef = firebaseDatabase.ref('usuarios').child(usuarioUid).child('disciplinasAgendadas');
  }
  export default {
    name: 'impressao',
    firebase: {
      usuario: usuarioRef
    },
    beforeCreate: function() {
      firebase.auth().onAuthStateChanged(function(user){
       if (!user) {
         window.location.href = "/"
       } else if(user.displayName == "adm") {
          window.location.href = "/cadastrar";
        }
      })
    },
    methods: {
      imprimir: function() {
        $("#btnImprimir").hide();
        window.print();
        $("#btnImprimir").show();
      }
    },
    filters: {
      dataFormatada: function (data) {
        var dataParse = JSON.parse(data)
        return moment(dataParse).format('DD/MM/YYYY')
      },
      horarioFormatado: function (data) {
        var dataParse = JSON.parse(data)
        return moment(dataParse).format('HH:mm')
      },
    }
  };
</script>


{'fraction_non_alphanumeric': 0.15738191061215845, 'fraction_numerical': 0.002965473416649015, 'mean_word_length': 2.2122448979591836, 'pattern_counts': {'":': 0, '<': 96, '<?xml version=': 0, '>': 96, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1335111', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1588, 'n_words': 288}