Last active
March 28, 2017 16:48
-
-
Save TristanWiley/606df83e3234883cc27a4b01930e922c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s = '<button id="pastToggle" style="margin: 0 auto;display:block;">Show/Hide Past Hackathons</button>'; // HTML string | |
var div = document.createElement('div'); | |
div.innerHTML = s; | |
$('.row.feature').children().get(0).append(div); | |
$('#pastToggle').click(function() { | |
$('.event').each(function(item){ | |
var date = Date.parse($(this).find('meta[itemprop="endDate"]').attr('content')); | |
var currentTime = (new Date).getTime(); | |
var inPast = date<currentTime; | |
if(inPast){ | |
console.log($(this).toggle()); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment