Determines whether or not the passed value is a valid month.
JSV_isMonth(expM)
n/a
The isMonth function returns true if the expression expM is a valid month; otherwise, false.
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.) |
n/a
JSV_isWhitespace, JSV_isInteger, JSV_toString
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
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.