Sorry for the rookie like mistake, i wasn't having any problem with tabulation or word wrap and didn't think that someone else would...my bad! Hope this helps!!! Thanks
Code:
<cfquery name="GetStartDate" datasource="#ffldsn#">
Select PropValue
From ffl_prop
where propname='StartDraftTime' and Leagueid = #LeagueValue#
</cfquery>
<cfset DraftTickerTime = ParseDateTime("#GetStartDate.PropValue#")>
<cfset DraftTickerTime = DateAdd("n",-2,"#DraftTickerTime#")>
<cfset DraftTickerTime = DateAdd("s",15,"#DraftTickerTime#")>
<cfoutput>
var yr=#dateFormat(DraftTickerTime,"yyyy")#;
var mo=#dateFormat(DraftTickerTime,"m")#;
var da=#dateFormat(DraftTickerTime,"d")#;
var ho=#TimeFormat(DraftTickerTime,"H")#;
var mi=#TimeFormat(DraftTickerTime,"m")#;
var sec=#TimeFormat(DraftTickerTime,"s")#;
</cfoutput>
//The above code works...it translate a value in a
//database to the date using coldfusion, then adds 3
//min for the futrue time
function countdown()
{
var today = new Date();
var todayy = today.getYear();
if(todayy < 1000)
{
todayy += 1900;
}
var todaym = today.getMonth();
var todayd = today.getDate();
var todayh = today.getHours();
var todaymin = today.getMinutes();
var todaysec = today.getSeconds();
var todaystring = todaym+"/"+todayd+"/"+todayy+" "+todayh+":"+todaymin+":"+todaysec;
futurestring = (mo-1)+"/"+da+"/"+yr+" "+ho+":"+mi+":"+sec;
dd = Date.parse(futurestring)-Date.parse(todaystring);
dday = Math.floor(dd/(60*60*1000*24)*1);
dhour = Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1);
dmin = Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
dsec = Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
if(document.getElementById)
{
if(dsec <= 0 && dmin <= 0 && dday <= 0)
{
//When countdown ends!!
var countdownDiv = document.getElementById("countdown");
countdownDiv.innerHTML = "<b><div class='small'><font color='red'>Times Up!<BR>Please Draft</font></div></b>";
}
else if(dmin > 6)
{
//When countdown ends!!
var countdownDiv = document.getElementById("countdown");
countdownDiv.innerHTML = "<b><div class='small'><font color='red'>Times Up!<BR>Please Draft</font></div></b>";
}
//if on day of occasion
else if(todayy == yr && todaym == (mo-1) && todayd == da)
{
// need to handle this!!
var countdownDiv = document.getElementById("countdown");
countdownDiv.innerHTML = "<b>" + dmin + "</b> m <b>" + dsec + "</b> s";
setTimeout("countdown()",1000)
}
//else, if not yet
else
{
}
}
}
if(document.getElementById)
{
document.write("<div id=countdown></div>");
document.write("<br>");
countdown();
}
else
{
document.write("<br>");
document.write("<div></div>");
document.write("<br>");
}
Bookmarks