Description: nextDate.js is helpful if you are trying to embed an automatic countdown timer on your website. It simple and less complex that the idea might seem. Basically, you just have to input the day you request. For example, if you'd like to obtain next Monday's date.
Future Path: I will be working on functionality for holidays and so on.
INSTRUCTION
Create an html file and include the content below.
---------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Get next Date</title>
<script type="text/javascript" src="nextdate.js"></script>
<script type="text/javascript">
window.onload = function()
{
//To fetch how many days to Next Sunday at 5pm(12+5 = 17 G.M.T).
tDay = "Monday";
tHour = 17;
tMin = 0;
tSeconds = 0;
var daysTillNextSunday = day.Next(tDay,tHour,tMin,tSeconds);
document.getElementById('timetillnextSunday').innerHTML =daysTillNextSunday.getMonth()+"-"+daysTillNextSunday.getDate()+"-"+daysTillNextSunday.getFullYear();
//right now
ds =new Date();document.getElementById('daterightnow').innerHTML+=ds.getMonth()+"-"+ds.getDate()+"-"+ds.getFullYear()+" "+ds.getHours()+":"+ds.getMinutes()+":"+ds.getSeconds();
}
</script>
<style type="text/css">
<!--
body
{
background-color:#999;
}
p {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
h1,h3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
background-color:#FFF;
display:inline-block;
padding:0px;
margin:2px;
text-shadow:1px 1px 1px #ccc;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
margin-bottom:0px;
}
-->
</style>
</head>
<body>
<center>
<div style="background-color:white">
<h2>Right now is </h2>
<h3 id="daterightnow"></h3>
<h2>NEXT Monday at 5pm is</h2>
<h1 id='timetillnextSunday'></h1>
</div>
</center>
</body>
</html>
Then right click and save nextdate.js in the same directory.
-----------------
Finished!
This should be your result. DEMO