I have a filtered list view web part on my SharePoint page that shows only the current month's birthdays. I searched online and was able to find code to automatically change the title to "Current Month's Birthdays!" based on the date (modified code below). Thanks Dipendra Bhowmick!
<script src="https://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#WebPartTitleWPQ6 h2 a nobr span').text('');
var mnth=new Array(12);
mnth[0]="January";
mnth[1]="February";
mnth[2]="March";
mnth[3]="April";
mnth[4]="May";
mnth[5]="June";
mnth[6]="July";
mnth[7]="August";
mnth[8]="September";
mnth[9]="October";
mnth[10]="November";
mnth[11]="December";
var monthofyear = mnth[new Date().getMonth()];
$('#WebPartCaptionWPQ6').text(monthofyear + " Birthdays!");
</script>
I'd also like to change the background color of the web part based on the current month so it will match the Title image.
I am "not allowed" to use SharePoint Designer so have used code to do the formatting in the image above. I'd just rather not have to update it every month.
I modified the code here to create an array of colors that will pull the appropriate color based on the date, but I'm not very experienced with JQuery or JavaScript and have only recently discovered DOM Explorer so I'm struggling to find the correct syntax to identify the web part header background element. Any help is appreciated!