Created
April 25, 2019 19:58
-
-
Save davidmerfield/0c45c49a7b6a625e71aa68a509d2a9f8 to your computer and use it in GitHub Desktop.
Will hide
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
// CSS selector which will match all the HTML elements containing a date | |
var dateSelector = '.date'; | |
// Iterate over all the dates, hiding each date identical to its immediate predeccessor | |
Array.from(document.querySelectorAll(dateSelector)).reduce(function(previousDate, el){ | |
if (previousDate && previousDate === el.innerHTML) | |
el.style.display='none'; | |
return el.innerHTML; | |
}, ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment