Admin Admin
Number of posts : 262 Join date : 08.03.12 Age : 62 Dzīvesvieta : Talsi
| Tēma: Vēl viens atpakaļskaitītājs līdz Jaunajam gadam Piektdiena Novembris 09, 2012 6:41 pm | |
| - Kods:
-
<Script Language="JavaScript"> function myFunction1(){ if (date<=myDate) month1=12-(month-myMonth); else month1=11-(month-myMonth);} function myFunction2(){ if (date>myDate) month1=(myMonth-month-1); else month1=(myMonth-month);} function myFunction3(){ if (date<=myDate) month1=0; else month1=11;} function myFunction4(){ if (month==2) date1=(28-date+myDate); if (month==4) date1=(30-date+myDate); if (month==6) date1=(30-date+myDate); if (month==9) date1=(30-date+myDate); if (month==11) date1=(30-date+myDate); if (month==1) date1=(31-date+myDate); if (month==3) date1=(31-date+myDate); if (month==5) date1=(31-date+myDate); if (month==7) date1=(31-date+myDate); if (month==8) date1=(31-date+myDate); if (month==10) date1=(31-date+myDate); if (month==12) date1=(31-date+myDate);}
var date=(new Date()).getDate(); var month=(new Date()).getMonth()+1; var myDate=01 var myMonth=01 if (month>myMonth) myFunction1(); if (month<myMonth) myFunction2(); if (month==myMonth) myFunction3(); if (date<=myDate) date1=(myDate-date); if (date>myDate) myFunction4(); if (month1==1) monthtxt=("mēnesis"); if (month1>1 && month1<5) monthtxt=("mēneši"); if (month1>4) monthtxt=("месяцев"); if (date1==1, 21) datetxt=("diena"); if (date1>1 && date1<5) datetxt=("dienas"); if (date1>21 && date1<25) datetxt=("dienas"); if (date1>4 && date1<21) datetxt=("dienas"); if (date1>24 && date1<31) datetxt=("dienas");
var txt=("Līdz Jaunajam gadam:"); if (month1==0 && date1==0) txt=("šodien 1. janvāris"); document.write(txt+' '); if (month1>0) document.write(month1+" "+monthtxt+' '); else document.write(""); if (date1>0) document.write(date1+" "+datetxt); else document.write(""); </Script> | |
|