Jump to content

Pofski

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Pofski

  1. Hi,

     

    i was wondering if anybody could help me out with the following problem.

     

    I have a counter that counts up from a certain date.

    the counter date is the date of any type of incident at the company where i work.

    Whenever something happens, i change the date in the script, but i was wondering if there would be a more user friendly way of doing this.

     

    What i am trying to do is integrate a datafield where certain users, depending on their user id, could enter a new date in case something happens, and this would change the date in the script.

     

     

    Thank you in advance for your help.

     

     

     

     <head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title>Untitled 1</title> <script>window.onload=function(){var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")  var myDate=new Date(); function countUp(yr, mo, da){   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=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec   paststring=montharray[mo-1]+" "+da+", "+yr   dd=Date.parse(todaystring)-Date.parse(paststring)   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)   return (dday + " days, " + dhour + " hours, " + dmin + "mins, " + dsec + " seconds");} function drawCountUp(){    var tdOne = document.getElementById("one");    tdOne.innerHTML = countUp(2012, 9, 19);    var tdTwo = document.getElementById("two");    tdTwo.innerHTML = countUp(2012, 8, 19);    var tdThree = document.getElementById("three");    tdThree.innerHTML = countUp(2012,7, 19);}drawCountUp();   setInterval(drawCountUp,1000);}</script>  </head> <body>   <table><tr><td>One</td><td id='one'></td></tr><tr><td>Two</td><td id='two'></td></tr><tr><td>Three</td><td id='three'></td></tr> </table>  <input datafld="first" name="one" size="35" type="text" /><button onclick="myFunction{}">input date</button> </body>  

     

     

×
×
  • Create New...