refactor(date): added format friendly (#8)

This commit is contained in:
Marcos Ellys Rocha Honorato 2018-10-05 18:26:29 -03:00 committed by Samar Dhwoj Acharya
parent c16032dbc0
commit c179c1aa60
2 changed files with 2 additions and 0 deletions

View file

@ -12,6 +12,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script> <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/js/jquery.dataTables.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<style> <style>
body { body {
padding-top: 2rem; padding-top: 2rem;

View file

@ -36,6 +36,7 @@ function updateDT( data ) {
for ( let fork of data ) { for ( let fork of data ) {
fork.repoLink = `<a href="https://github.com/${fork.full_name}">Link</a>` fork.repoLink = `<a href="https://github.com/${fork.full_name}">Link</a>`
fork.ownerName = fork.owner.login fork.ownerName = fork.owner.login
fork.pushed_at = moment(fork.pushed_at).fromNow()
forks.push( fork ) forks.push( fork )
} }
const dataSet = forks.map( fork => window.columnNamesMap.map( colNM => fork[colNM[1]] ) ) const dataSet = forks.map( fork => window.columnNamesMap.map( colNM => fork[colNM[1]] ) )