I need to make a web part in(SharePoint 2010) visible to users during a certain date range. My attempt is to use Java to do so, however, the code doesn't seem to work. I know the function works as I've successfully implemented it using and "on click" function with a button. That said, I would like to hide it using Java. Please advise if another solution is more viable or if something is wrong with my JavaScript. Thanks
Here's my Java:
<!--DOCTYPE html--><script>
var d = new Date();
var n = d.getDate();
var p = d.getMonth();
if ((d.getMonth() >= 2 && <= 3))
function myFunction() {
$('#MSOZoneCell_WebPartWPQ2').hide();
} </script>
Here's my Java:
<!--DOCTYPE html--><script>
var d = new Date();
var n = d.getDate();
var p = d.getMonth();
if ((d.getMonth() >= 2 && <= 3))
function myFunction() {
$('#MSOZoneCell_WebPartWPQ2').hide();
} </script>