Skript na datum aktualizacie

From: Blanka Ulaherová (ulaher@za.psg.sk)
Date: 10. 09. 2003, 10:28 CEST


Ak pouzijem skript:
*************
<script language="JavaScript" type="text/javascript">
<!--
lastmod = document.lastModified
lastmoddate = Date.parse(lastmod)
if(lastmoddate == 0){
document.writeln("Dátum poslednej úpravy neznámy")   } else {
document.writeln("Posledná úprava: " + lastmod)}
// -->
</script>
*********

je datum MM/DD/RRRR, co mozno trochu myli navstevnikov, ale v Mozille a
Opere skript vyznieva dobre.

Ak pouzijem:
*******
<script language="JavaScript">
<!--
var now = new Date();
var yr = now.getYear();
var mName = now.getMonth() + 1;
var dName = now.getDay() + 1.;
var dayNr = ((now.getDate()<10) ? "" : "")+ now.getDate();

if(dName==1) Day = "Nedeľa";
if(dName==2) Day = "Pondelok";
if(dName==3) Day = "Utorok";
if(dName==4) Day = "Streda";
if(dName==5) Day = "Štvrtok";
if(dName==6) Day = "Piatok";
if(dName==7) Day = "Sobota";
if(mName==1) Month="1.";
if(mName==2) Month="2.";
if(mName==3) Month="3.";
if(mName==4) Month="4.";
if(mName==5) Month="5.";
if(mName==6) Month="6.";
if(mName==7) Month="7.";
if(mName==8) Month="8.";
if(mName==9) Month="9.";
if(mName==10) Month="10.";
if(mName==11) Month="11.";
if(mName==12) Month="12.";

// String to display current date.
   var todaysDate =(" "
       + Day
       + " "
       + dayNr
       + ". "
        + Month
       + " "
       + " "
       + yr);
// Write date to page.

document.open();

document.write("<center><b><font color=#000080 size=2 face=arial>    "
+todaysDate+"</font></b></center>");
// -->
</script>
 *************
v IE to vypíše "Streda 10.9.2003", ale v Mozille a Opere " Streda 10.9.103".

Urcite sa do da vyriesit tak, ze sa nadeklaruje, aby IE cital jeden a Opera
a Mozilla ten druhy. Ako sa to da urobit?

Dakujem

Blanka



This archive was generated by hypermail 2.1.3 : 10. 09. 2003, 10:34 CEST