Wijmo UI for the Web
validateDate Method
wijmo.input Namespace > IFormatValidateLib Interface : validateDate Method
The string value to validate as a date.
The earliest date to accept as a valid value.
The latest date to accept as a valid value.
The formatting string to use in validating the value.
For the full list of supported format keywords, see Date Format Keywords.
The culture to use in validating the date.

Use this method to validate the specified value against the specified options and return a Boolean value. If the value cannot be parsed with the specified parameters, it returns false. To use this method, instead of wijmo.input.IFormatValidateLib.validateDate, use $.wijinputcore.validateDate. See example below for the correct usage.

Syntax
var instance; // Type: wijmo.input.IFormatValidateLib;
var returnValue; // Type: bool

// Parameters
var value; // Type:  string
var minDate; // Type:  Date
var maxDate; // Type:  Date
var format; // Type:  string
var culture; // Type:  string

returnValue = instance.validateDate(value, minDate, maxDate, format, culture);
function validateDate( 
   value : string,
   minDate : Date,
   maxDate : Date,
   format : string,
   culture : string
) : bool;

Parameters

value
The string value to validate as a date.
minDate
The earliest date to accept as a valid value.
maxDate
The latest date to accept as a valid value.
format
The formatting string to use in validating the value.
For the full list of supported format keywords, see Date Format Keywords.
culture
The culture to use in validating the date.

Return Value

Returns a bool indicating whether the string date value is within the specified date range.
Example
$.wijinputcore.validateDate("12/3/2012", new Date(2013,0,1), new Date(2013,11,31));  // returns: false
$.wijinputcore.validateDate("平成 25年12月16日", new Date(2013,0,1), new Date(2013,11,31), "ggg ee年MM月dd日");  // returns: false
See Also

Reference

IFormatValidateLib Interface