HTML/CSS/JAVASCRIPT 강의실

시삽: 레드플러스 님 
게시판 이동:
 제목 : 19일차 강의내용 - 자바스크립트 사용 예제 - 달력
글번호: 36
작성자: 관리자
작성일: 2001/02/01 오전 1:14:00
조회수: 4910
파일: 예제-달력.htm (4 KB) / 전송수: 2885
<HTML>
<HEAD>
<TITLE>달력</TITLE>

</HEAD>
<BODY>

<P><SCRIPT language="Javascript">
calendar = new Date();
day = calendar.getDay();
document.write("<font face=arial><center><table width=100 border=1 cellspacing=0 cellpadding=0><td><center><font size=2>")
if (day == 0) {
document.write("Sunday")
}
if (day == 1) {
document.write("Monday")
}
if (day == 2) {
document.write("Tuesday")
}
if (day == 3) {
document.write("Wednesday")
}
if (day == 4) {
document.write("Thursday")
}
if (day == 5) {
document.write("Friday")
}
if (day == 6) {
document.write("Saturday")
}
if (day == 7) {
document.write("Sunday")
}
document.write("</font></center></td><tr><td><center><font size=2>")
month = calendar.getMonth();
if (month == 0) {
document.write("January")
}
if (month == 1) {
document.write("February")
}
if (month == 2) {
document.write("March")
}
if (month == 3) {
document.write("April")
}
if (month == 4) {
document.write("May")
}
if (month == 5) {
document.write("June")
}
if (month == 6) {
document.write("July")
}
if (month == 7) {
document.write("August")
}
if (month == 8) {
document.write("September")
}
if (month == 9) {
document.write("October")
}
if (month == 10) {
document.write("November")
}
if (month == 11) {
document.write("December")
}

document.write("</font></center></td><tr><td><center><font size=7 color=red>")
date = calendar.getDate();
document.write(date)
document.write("</font></center></td><tr><td><center><font size=2>")
year = calendar.getYear();
if (year < 100) {
document.write("19" + year + "")
}
else if (year > 1999) {
document.write(year)
}
document.write("</font></center></td></table><P><table width=100 border=1 cellspacing=0 cellpadding=0><td><center><font size=2>")
document.write("")
if (month == 0) { if (date == 1) {
document.write("New Years Day")
}
}
if (month == 0) { if (date > 14) { if (date < 23) { if (day == 1) {
document.write("Martin Luther King's Birthday")
}
}
}
}
if (month == 1) { if (date == 12) {
document.write("Lincoln's Birthday")
}
}
if (month == 1) { if (date == 14) {
document.write("Valentine's Day")
}
}
if (month == 1) { if (date > 14) { if (date < 22) { if (day == 1) {
document.write("President's Day")
}
}
}
}
if (month == 1) { if (date == 22) { if (day == 1) {
document.write("President's Day<BR>")
}
}
}
if (month == 1) { if (date == 22) {
document.write("Washington's Birthday")
}
}
if (month == 10) { if (date == 5) {
document.write("박용준의 생일...")
}
}
if (month == 2) { if (date == 17) {
document.write("St. Patrick's Day")
}
}
if (month == 3) { if (date > 0) { if (date < 8) { if (day == 0) {
document.write("Daylight Savings Time Begins")
}
}
}
}
if (month == 4) { if (date > 7) { if (date < 16) { if (day == 0) {
document.write("Mother's Day")
}
}
}
}
if (month == 4) { if (date > 24) { if (day == 1) {
document.write("Memorial Day")
}
}
}
if (month == 5) { if (date == 14) {
document.write("Flag Day")
}
}
if (month == 5) { if (date > 15) { if (date < 24) { if (day == 0) {
document.write("Father's Day")
}
}
}
}
if (month == 6) { if (date == 4) {
document.write("Independence Day")
}
}
if (month == 8) { if (date > 0) { if (date < 8) { if (day == 1) {
document.write("Labor Day")
}
}
}
}
if (month == 9) { if (date > 7) { if (date < 16) { if (day == 1) {
document.write("Columbus Day")
}
}
}
}
if (month == 9) { if (date > 24) { if (date < 31) { if (day == 0) {
document.write("Daylight Savings Time Ends")
}
}
}
}
if (month == 9) { if (date == 31) { if (day == 0) {
document.write("Daylight Savings Time Ends<BR>")
}
}
}
if (month == 9) { if (date == 31) {
document.write("Halloween")
}
}
if (month == 10) { if (date == 11) {
document.write("Veteran's Day")
}
}
if (month == 10) { if (date > 23) { if (date < 30) { if (day == 4) {
document.write("Thanksgiving")
}
}
}
}
if (month == 10) { if (date == 30) { if (day == 4) {
document.write("Thanksgiving")
}
}
}
if (month == 11) { if (date == 24) {
document.write("Christmas Eve")
}
}
if (month == 11) { if (date == 25) {
document.write("Christmas")
}
}
if (month == 11) { if (date == 31) {
document.write("New Year's Eve")
}
}
document.write("</font></center></td></table>")
</SCRIPT>
</P>
<P><FONT face="굴림" size="2" color="#92672E">크기, 모양 고쳐서 쓰세요..</FONT></P>

</body>
</HTML>
 
이전 글   다음 글 삭제 수정 답변 글쓰기 리스트

(댓글을 남기려면 로그인이 필요합니다.)

관련 아티클 리스트
  제       목 파일 작성자 작성일 조회
이전글 20일차 강의내용 - 자바스크립트 사용 예제 - 주민등록번호체크 예제-주민등록번호체크.htm(3 KB) 관리자 2001-02-01 4786
현재글 19일차 강의내용 - 자바스크립트 사용 예제 - 달력 예제-달력.htm(4 KB) 관리자 2001-02-01 4910
다음글 19일차 강의내용 - 자바스크립트 사용 예제 - 간단계산기 예제-간단계산기.htm(2 KB) 관리자 2001-02-01 6075
 
손님 사용자 Anonymous (손님)
로그인 Home