Autor Zpráva
senior
Profil
Mám JS:

<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=3 face=arial> " +todaysDate+"</font></b></center>");

// -->
</script>

Tento JS mi vo Firefoxe zobrazuje rok 2005 iba ako rok 105. Kde mám chybu? Vďaka za pomoc.
Polaroid
Profil
Možná by pomohlo místo metody getYear() použít metodu getFullYear()!
senior
Profil
Vďaka. Pomohlo to.
Polaroid
Profil
Neni zač!
Toto téma je uzamčeno. Odpověď nelze zaslat.

0