Created
February 7, 2016 08:33
-
-
Save beovulf/85e21a2c8f9234b3a019 to your computer and use it in GitHub Desktop.
Get day of week
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
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