Last active
August 29, 2015 14:03
-
-
Save le717/65733a3e020ab1270594 to your computer and use it in GitHub Desktop.
For Adventures in Website Design && Development – 6/26/14 (http://wp.me/p1V5ge-1zi)
This file contains 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 countDown() { | |
var today = new Date() | |
var dayOfWeek = today.toLocaleString() | |
dayLocate = dayOfWeek.indexOf(" ") | |
weekDay = dayOfWeek.substring(0, dayLocate) | |
newDay = dayOfWeek.substring(dayLocate) | |
dateLocate = newDay.indexOf(",") | |
monthDate = newDay.substring(0, dateLocate+1) | |
yearLocate = dayOfWeek.indexOf("2014") | |
year = dayOfWeek.substr(yearLocate, 4) | |
var bridalExpo = new Date("February 12, 2014") | |
var daysToGo = bridalExpo.getTime()-today.getTime() | |
var daysToBridalExpo = Math.ceil(daysToGo/(1000*60*60*24)) | |
var message ="Today is "+weekDay+" "+monthDate+" "+year+". We have "+daysToBridalExpo+" days until the Midwest Bridal Expo." | |
console.log(message); | |
} | |
countDown() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment