Determines whether or not the passed value is a valid day.

Syntax

JSV_isDay(expD, expM, expY)

Prototype

n/a

Returns

The isDay function returns true if the expression expD is a valid day for the given month expression expM and year expression expY; otherwise, false.

Parameters

The isDay function uses the following argument.

Argument Description
expD The day as an integer value of 1-31.
expM The month as an integer value of 1-12 for the day being tested.
expY The four-digit year for the day being tested.

Remarks

n/a

Dependencies

JSV_isLeapYear, JSV_isInteger, JSV_isMonth

Example

The following lines of code

var iDay = 29, iYear = 1999, iMonth = 2;
document.write( "Is " + iDay.toString().bold() + " a valid day for month " + 
    iMonth.toString().bold() + " of " + 
    iYear.toString().bold() + "? " + JSV_isDay(iDay,iMonth,iYear) );
iDay = 29; iYear = 2000; iMonth = 2;
document.write( "Is " + iDay.toString().bold() + " a valid day for month " + 
    iMonth.toString().bold() + " of " + 
    iYear.toString().bold() + "? " + JSV_isDay(iDay,iMonth,iYear) );
iDay = 31; iYear = 1999; iMonth = 11;
document.write( "Is " + iDay.toString().bold() + " a valid day for month " + 
    iMonth.toString().bold() + " of " + 
    iYear.toString().bold() + "? " + JSV_isDay(iDay,iMonth,iYear) );

produce