what is the current sunday
HTML
<script src="//www.addressfinder.co.nz/assets/v2/widget.js"></script>
<span id="current-sunday"></span>
JavaScript
$(document).ready(function() {
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var today = new Date();
var dateString = "";
//if day is currently sunday, skip ahead to writing string
if (today.getDay() == 0){
} else {
//else if it's not sunday, increment the date forward to the next sunday
for (i=today.getDay(); i<7; i++){
today.setDate(today.getDate() + 1);
};
};
//put together the date in a string and put it in the span
dateString = months[today.getMonth()] + " " + today.getDate() + ", " + today.getFullYear();
$("#current-sunday").text(dateString);
});