Last active
March 31, 2022 18:37
-
-
Save dantetesta/ad15c44021b998f5d35dcc7159efd95f to your computer and use it in GitHub Desktop.
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
<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