Product Information > JADE Encyclopaedia of Primitive Types > Chapter 1 - Primitive Types > isValid

isValid

isValid(): Boolean;

The isValid method of the Date primitive type returns true if the receiver is a valid date. This method returns false if the date is invalid.

This method also returns false for dates outside the valid internal representation range of 24th November -4713 through 31st December 1465072 Gregorian.

The code fragment in the following example shows the use of the isValid method.

if (day.String & "/" & month.String & "/" & year.String).Date.isValid then
    calendar.date.setDate(day, month, year);
else
    calendar.date.setDate(1, month, year);
endif;