Skip to content

Instantly share code, notes, and snippets.

@dantetesta
Last active March 31, 2022 18:37
Show Gist options
  • Save dantetesta/ad15c44021b998f5d35dcc7159efd95f to your computer and use it in GitHub Desktop.
Save dantetesta/ad15c44021b998f5d35dcc7159efd95f to your computer and use it in GitHub Desktop.
<script>
var hoje = jQuery('.hoje h2').text();
var expire = jQuery('.expire h2').text();
//jQuery('.expire, .hoje').hide();
function compareDates(hoje, expire){
const date1 = new Date(hoje);
const date2 = new Date(expire);
if(date1 <= date2){
jQuery('.aviso').hide();
jQuery('.dashboard').show();
} else if(date1 > date2){
jQuery('.aviso').show();
jQuery('.dashboard').hide();
}
}
compareDates(hoje, expire);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment