var EasyGUI_DateValidator = Class.create();

EasyGUI_DateValidator.format = 'dmy';

EasyGUI_DateValidator.messages =
{
	invalid: 	'%d is not a valid date !',
	nofuture:	'Future date is not allowed !',
	before: 	'Date has to be before %d !',
	after: 		'Date has to be after %d !'
}

Object.extend( Object.extend( EasyGUI_DateValidator.prototype, EasyGUI_Validator.prototype ), 
{	
	isvalid: function()
	{
		return DateTime.isValidDate( this.value, this.format );
	},
	
	nofuture: function()
	{
		return !DateTime.isFutureDate( this.value, this.format );
	},
	
	/**
	 * @todo implement
	 */
	before: function( value )
	{
		return true;
	},
	
	/**
	 * @todo implement
	 */
	after: function( value )
	{
		return true;
	}
});