jhylands

lucid dates updated ever so slightly

Feb 4th, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.40 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script>
  4. var tabledate = new Date();
  5. tabledate = setFullYear(2012,1,10);
  6. var today = new Date();
  7. function newval(){
  8.      alert('Running');
  9.      var dataHTML = document.getElementById('tabledate');
  10.      dataHTML.innerHTML = tabledate.toUTCString();
  11. //get the values
  12.      var erl = timetopx(parseFloat(document.getElementById('prestarth').value) + parseFloat(document.getElementById('prestartm').value) / 60);
  13.      var ideal = timetopx(parseFloat(document.getElementById('idealh').value) + parseFloat(document.getElementById('idealm').value) / 60);
  14.      var latre = timetopx(parseFloat(document.getElementById('lateh').value) + parseFloat(document.getElementById('latem').value) / 60);
  15.      var length = timetopx(parseFloat(document.getElementById('length').value));
  16. //Move the whole acordingly
  17.      var x = document.getElementById('maintime');
  18.      x.style.top = erl-464;
  19. //size the first cell
  20.      x = document.getElementById('maintimeE');
  21.      x.style.height = ideal - erl-3;
  22. //size the second to last cell
  23.      x = document.getElementById('maintimeFE');
  24.      x.style.height = ideal - erl-3;
  25. //size the middle unit
  26.      x = document.getElementById('maintimeM');
  27.      x.style.height = length - (latre-erl)-3;
  28. //size the second cell
  29.      x = document.getElementById('maintimeL');
  30.      x.style.height = latre - ideal-3;
  31. //size the last cell
  32.      x = document.getElementById('maintimeFL');
  33.      x.style.height = latre - ideal-3;
  34. }
  35. function timetopx(time){
  36. var px = time*19;
  37. return px;}//function takes the time in 0100 hours and turns it into a position reference
  38. </script>
  39. </head>
  40. <body>
  41. <ul><li>Times:hh:mm</li><li>Dates:dd/mm/yy</li><li>Length of time in hours</li></ul>
  42. <b> Earlyest:<input id="prestarth" maxlength=2 type="text" size="2"/>:<input id="prestartm" maxlength=2 type="text" size="2"/><input id="prestartd" maxlength=8 type="text" size="8"/></b><br />
  43. <b> Ideal: <input id="idealh" maxlength=2 type="text" size="2"/>:<input id="idealm" maxlength=2 type="text" size="2"/><input id="ideald" maxlength=8 type="text" size="8"/></b><br />
  44. <b> Latest:<input id="lateh" maxlength=2 type="text" size="2"/>:<input id="latem" maxlength=2 type="text" size="2"/><input id="lated" maxlength=8 type="text" size="8"/></b><br />
  45. <b>Length:</b><input id="length" type="text" /><br />
  46. <input type="button" value="Show" onclick="newval();"/>
  47.  
  48. <div  style="position:absolute;top:0px;left:300px;font-family:Arial;">
  49. Date:<date id="tabledate"> </date>
  50. <table id="alltime" border="1" style="width:220px;height:400px;overflow:scroll;" ><tr><td><div style="width:210px;height:390px;overflow:scroll;">
  51.  
  52. 00:00-</br>
  53. 01:00-</br>
  54. 02:00-</br>
  55. 03:00-</br>
  56. 04:00-</br>
  57. 05:00-</br>
  58. 06:00-</br>
  59. 07:00-</br>
  60. 08:00-</br>
  61. 09:00-</br>
  62. 10:00-</br>
  63. 11:00-</br>
  64. 12:00-</br>
  65. 13:00-</br>
  66. 14:00-</br>
  67. 15:00-</br>
  68. 16:00-</br>
  69. 17:00-</br>
  70. 18:00-</br>
  71. 19:00-</br>
  72. 20:00-</br>
  73. 21:00-</br>
  74. 22:00-</br>
  75. 23:00-</br>
  76. 24:00-<br/>
  77.  
  78. <table id="maintime"style="position:relative;background-color:#0099FF;top:-464px;right:-50px;width:136;height:114px;" >
  79. <tr id="maintimeE" height="10px"><td style="background-color:#19FFFF;"></td></tr>
  80. <tr id="maintimeL" height="10px"><td style="background-color:#19FFFF;"></td></tr>
  81. <tr id="maintimeM" ><td style="background-color:#19FFFF;"></td></tr>
  82. <tr id="maintimeFE" height="10px"><td style="background-color:#19FFFF;"></td></tr>
  83. <tr id="maintimeFL" height="10px"><td style="background-color:#19FFFF;"></td></tr></table>
  84. </div></td></tr></table>
  85.  
  86. </div>
  87.  
  88. </body>
  89. </html>
Advertisement
Add Comment
Please, Sign In to add comment