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


Syntax

JSV_isMonth(expM)

Prototype

n/a

Returns

The isMonth function returns true if the expression expM is a valid month; otherwise, false.

Parameters

The isMonth function uses the following argument.

Argument Description
expM The month to be tested. This can be a month as an integer value of 1-12, or the name of the month (e.g., Jan or December). (The validation of the month name is case insenstive.)

Remarks

n/a

Dependencies

JSV_isWhitespace, JSV_isInteger, JSV_toString

Example

The following lines of code

var i = 4, j = 13;
var thisMonth = "Jan";
document.write( "Is " + i.toString().bold() + " a valid month? " + JSV_isMonth(i) );
document.write( "Is " + j.toString().bold() + " a valid month? " + JSV_isMonth(j) );
document.write( "Is " + thisMonth.bold() + " a valid month? " + JSV_isMonth(thisMonth) );
var thisMonth = "October";
document.write( "Is " + thisMonth.bold() + " a valid month? " + JSV_isMonth(thisMonth) );
var thisMonth = "Captain";
document.write( "Is " + thisMonth.bold() + " a valid month? " + JSV_isMonth(thisMonth) );

produce