Skip to content

Instantly share code, notes, and snippets.

@beovulf
Created February 7, 2016 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beovulf/85e21a2c8f9234b3a019 to your computer and use it in GitHub Desktop.
Save beovulf/85e21a2c8f9234b3a019 to your computer and use it in GitHub Desktop.
Get day of week
function getDayOfWeek() {
var newDate = new Date();
newDate = newDate.getDay();
for(i=1;i<=6;i++) {
if(newDate == i) {
$('#day'+i).addClass('active-day').prepend('<p class="today"><b>TODAY</b></p>');
$('#day'+i).parent().css('background-color','#4A9D22');
} else if (newDate == 0 && i == 6) {
$('#day7').addClass('active-day').prepend('<p class="today"><b>TODAY</b></p>');
$('#day7').parent().css('background-color','#4A9D22');
}
}
}
getDayOfWeek();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment