Javascript for validating a date February 26, 2008
Posted by Arun Vishnu in colour code, Internet, java script, web.add a comment
Javascript for validating a date.
Pass month, day, year as parameters. This function will return true if the date is valid.
//
// arunmvishnu.blogspot.comfunction validDate(month, day, year){
if(month ==’0′ || day ==’0′ || year==’0′){
return false;
}
switch(month)
{
case ’1′: //** jan
case ’3′: //** March
case ’5′: //** May
case ’7′: //** July
case ’8′: //** Aug
case ’10′: //** Nov
case ’12′: //** Dec
if(day>=1 && day<=31){
return true;
} else {
return false;
}
case ’4′: //** APRIL
case ’6′ : //** JUNE
case ’9′ : //** SEPTEMBER
case ’11′ : //** NOVEMBER
if(day>=1 && day<=30){
return true;
} else {
return false;
}
case ’2′ :
if(isLeapYear(year)){
if(day>=1 && day<=29){
return true;
}
} else if(day>=1 && day <= 28){
return true;
} else {
return false;
}
default:
return false;
}
}
function isLeapYear(year){ // Checking wdr a year is leap year or not
if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
return true;
} else {
return false;
}
}
The full js file can be dodnloaded from here
Valentine’s Day February 13, 2007
Posted by Arun Vishnu in colour code, Valentine's Day.1 comment so far
Color Code
——————–
Blue — Free
Green — Waiting
Orange — Going 2 propose
Pink — Accepted
Black — Rejected
White — Already booked
Yello — Brarke up
Gray — Not interested
Red — Leave me alone
All other colors — All Indians are my brothers and sisters




