I'm new to learning JQuery and I am trying to write a script that will only display text inside a div after May 1 and before June 1. This needs to ignore the year and only show the dive between these limits. Here is what I've been experimenting with:
<script type="text/javascript">
var today = new Date();
//month begins with 0
if ((today.getMonth() > 04 && today.getDate() > 01) || (today.getMonth() < 05 && today.getDate() < 01)){
$('#cellOne').show();
}
else {
$('#cellOne').hide();
}
</script>
Since today is not between these limits, I believe the div should be hidden, but I can't get it to work. Can anyone put me on the right path here? It is possible I have a logic error as I'm not very experience with JavaScript and JQuery. Much obliged.
For this particular situation, calculating the day of the year is not an ideal solution, mostly because when I hand the website back over to daily administrators they will not understand how to update the code.