Script Kalender dan Jam Digital

<$script>

setCal()

function getTime() {
// initialize time-related variables with current time settings
var now = new Date()
var hour = now.getHours()
var minute = now.getMinutes()
now = null
var ampm = ""

// validate hour values and set value of ampm
if (hour >= 12) {
hour -= 12
ampm = "PM"
} else
ampm = "AM"
hour = (hour == 0) ? 12 : hour

// add zero digit to a one digit minute
if (minute < minute = "0" 4 ="="" ar =" new" ar =" new" now =" new" year =" now.getYear()" month =" now.getMonth()" monthname =" getMonthName(month)" date =" now.getDate()" now =" null" firstdayinstance =" new" firstday =" firstDayInstance.getDay()" firstdayinstance =" null" days =" getDays(month," headerheight =" 50" border =" 2" cellspacing =" 4" headercolor = "midnightblue" headersize = "+3" colwidth =" 60" daycellheight =" 25" daycolor = "darkblue" cellheight =" 40" todaycolor = "red" timecolor = "purple" text = "">'
text += '<$TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + '>' // table settings
text += '<$TH COLSPAN=7 HEIGHT=' + headerHeight + '>' // create table header cell
text += '<$FONT SIZE=' + headerSize + ' style="color:' + headerColor + ';">' // set font for table header
text += monthName + ' ' + year
text += '<$/FONT>' // close table header's font settings
text += '<$/TH>' // close header cell

// variables to hold constant settings
var openCol = '<$TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>'
openCol += '<$FONT style="color:' + dayColor + ';">'
var closeCol = '<$/FONT>'

// create array of abbreviated day names
var weekDay = new Array(7)
weekDay[0] = "Sun"
weekDay[1] = "Mon"
weekDay[2] = "Tues"
weekDay[3] = "Wed"
weekDay[4] = "Thu"
weekDay[5] = "Fri"
weekDay[6] = "Sat"

// create first row of table to set column width and specify week day
text += '<$TR ALIGN="center" VALIGN="center">'
for (var dayNum = 0; dayNum <$ 7; ++dayNum) { text += openCol + weekDay[dayNum] + closeCol } text += '<$/TR>'

// declaration and initialization of two variables to help with tables
var digit = 1
var curCell = 1

for (var row = 1; row <$= Math.ceil((lastDate + firstDay - 1) / 7); ++row) { text += '<$TR ALIGN="right" VALIGN="top">'
for (var col = 1; col <$= 7; ++col) { if (digit $>$ lastDate)
break
if (curCell <$ firstDay) { text += '<$TD><$/TD>';
curCell++
} else {
if (digit == date) { // current cell represent today's date
text += '<$TD HEIGHT=' + cellHeight + '>'
text += '<$FONT style="color:' + todayColor + ';">'
text += digit
text += '<$/FONT><$BR>'
text += '<$FONT SIZE=2 style="color:' + timeColor + ';">'
text += '<$CENTER>' + getTime() + '<$/CENTER>'
text += '<$/FONT>'
text += '<$/TD>'
} else
text += '<$TD HEIGHT=' + cellHeight + '>' + digit + '<$/TD>'
digit++
}
}
text += '<$/TR>'
}

// close all basic table tags
text += '<$/TABLE>'
text += '<$/CENTER>'

// print accumulative HTML string
document.write(text)
}
<$/script>
<$p align="center"><$font style="font-family:arial;font-size:-2;">This free script provided by<$/font><$br>
<$font style="font-family:arial, helvetica;font-size:-2;"><$a href="http://javascriptkit.com">JavaScript
Kit<$/a><$/font><$/p>
0 komentar:

Labels

Blogumulus by Roy Tanck and Amanda Fazani

Followers


Ngobrol yuu...!!


ShoutMix chat widget

Waktu