Dashboard CustomBoxes - HPOnline

      Dashboard CustomBoxes - HPOnline

      Dashboard CustomBoxes - HPOnline

      Source Code

      1. <center>
      2. <p><script language="JavaScript">
      3. <!--
      4. today = new Date();
      5. bYear = 2000; // Start Jahr
      6. bMonth = 07; // Start Monat
      7. bDay = 12; // Start Tag
      8. tYear = today.getFullYear();
      9. tMonth = (today.getMonth() ) + 1 ;
      10. tDay = today.getDate();
      11. tHour = today.getHours();
      12. fYear = 0;
      13. fMonth = 0;
      14. fDay = 0;
      15. fHour = 0;
      16. x = 0;
      17. y = 0;
      18. z = 0;
      19. a = 0;
      20. b = 0;
      21. c = 0;
      22. function testMonth() {
      23. if (y==4 || y==6 || y==9 || y==11) x=30
      24. else if (y==2) x=28
      25. else x=31
      26. }
      27. function testDay() {
      28. fDay = (z - bDay) + tDay;
      29. if (fDay > a) {
      30. fMonth += 1;
      31. fDay = fDay - a;
      32. }
      33. }
      34. y = bMonth;
      35. testMonth();
      36. z = x;
      37. y = bMonth;
      38. testMonth();
      39. a = x;
      40. if (bMonth <= tMonth) {
      41. fYear = tYear - bYear;
      42. fMonth = (tMonth - bMonth);
      43. testDay();
      44. }
      45. fYear = (tYear - bYear) - 1
      46. fMonth = ((12 - bMonth) + tMonth) - 1;
      47. testDay();
      48. if (fMonth >= 12) {
      49. fYear += 1;
      50. fMonth -= 12;
      51. }
      52. with(Math) {
      53. theYear=fYear;
      54. tensYear=floor(theYear/10);
      55. onesYear=theYear-(tensYear*1);
      56. theMonth=fMonth
      57. tensMonth=floor(theMonth/10);
      58. onesMonth=theMonth-(tensMonth*1);
      59. theDay=fDay
      60. tensDay=floor(theDay/10);
      61. onesDay=theDay-(tensDay*1);
      62. var testArray = new makeArray("Januar","Februar","M&auml;rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
      63. for (z=1; z<=12; z++) {
      64. if (tMonth==z) {
      65. var b=testArray[z]
      66. }
      67. }
      68. for (z=1; z<=12; z++) {
      69. if (bMonth==z) {
      70. var c=testArray[z]
      71. }
      72. }
      73. }
      74. var page
      75. page = "Heutiges Datum: <b>"+tDay+". "+b+" "+tYear+".</b><br>"
      76. page += "Diese Seite ist seit dem <b>"+bDay+". "+c+" "+bYear+"</b> im Netz<br>"
      77. page += "Also genau <b>"
      78. if(parseInt(tensYear+onesYear) == 1) {
      79. page += tensYear + onesYear + " Jahr</b>,<b> "
      80. }
      81. else {
      82. page += tensYear + onesYear + " Jahre</b>,<b> "
      83. }
      84. if(parseInt(tensYear+onesYear) == 0) {
      85. page += ""
      86. }
      87. if(parseInt(tensMonth+onesMonth) == 1) {
      88. page += tensMonth + onesMonth + " Monat </b>und<b> "
      89. }
      90. else {
      91. page += tensMonth + onesMonth + " Monate </b>und<b> "
      92. }
      93. if(parseInt(tensDay+onesDay) == 1) {
      94. page += tensDay + onesDay + " Tag</b>."
      95. }
      96. else {
      97. page += tensDay + onesDay + " Tage</b>."
      98. }
      99. function makeArray() {
      100. this.length = makeArray.arguments.length
      101. for (var i = 0; i < this.length; i++)
      102. this[i+1] = makeArray.arguments[i]
      103. }
      104. document.write(page)
      105. // -->
      106. </script>
      107. </center>