Last active
December 17, 2015 16:09
-
-
Save maxxcrawford/5636909 to your computer and use it in GitHub Desktop.
Show/Hide Date Expiration
This file contains hidden or 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 dateExpire = function(){ | |
var today = new Date(); //Get Raw Current Date | |
var dd = today.getDate(); // Formate Date | |
var mm = today.getMonth()+1; // Format Month | |
var yyyy = today.getFullYear(); | |
if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = mm+'/'+dd+'/'+yyyy; // Assemble mm/dd/yy date | |
$('.boo').each(function(){ | |
if ($(this).attr('data-expire') < today){ | |
$(this).hide(); | |
} else { | |
// Date shows by default $(this).show(); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment