Dynamic Weekday

Function

</ head>

</ body>

<!-- DYNAMIC WEEKDAY --> 
<script>

	//Dynamic Weekday
	$(document).ready(function(){
		// Get current day of the week
		var d = new Date();
		var weekday = new Array(7);
		weekday[0] = "Sunday";
		weekday[1] = "Monday";
		weekday[2] = "Tuesday";
		weekday[3] = "Wednesday";
		weekday[4] = "Thursday";
		weekday[5] = "Friday";
		weekday[6] = "Saturday";
		var n = weekday[d.getDay()];
    
    document.querySelectorAll(".weekday").forEach(function(weekday) {
  		weekday.innerHTML = n;
    });
	});

</script>

HTML/Embed

Author
Traf
Published
May 21, 2020

How to use:

Tutorial Coming Soon!

This snippet will generate the text dynamically for the correct weekday where ever you want in your project.

Clone Project
Documentation
Author:
Built by
Built with
For the best experience

Please switch to desktop to view the content.

Back Home
Thank you! Your submission has been received!
Close Form
Oops! Something went wrong while submitting the form.
Become a Contributor