From 5a0d132114ac7da02edf4c676c6bb6e55f45b4d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mart=C3=ADn=20Marrese?= Date: Wed, 11 Jun 2003 15:58:29 +0000 Subject: [PATCH] - Funcion validate que verifica si una fecha es valida --- HTML/php/QuickForm/mdate.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/HTML/php/QuickForm/mdate.php b/HTML/php/QuickForm/mdate.php index 4fe0e42..e364286 100644 --- a/HTML/php/QuickForm/mdate.php +++ b/HTML/php/QuickForm/mdate.php @@ -29,6 +29,7 @@ require_once('HTML/QuickForm/date.php'); require_once('Date.php'); +require_once('Validate.php'); /** * Class to dynamically create HTML Select elements from a date @@ -104,6 +105,19 @@ class HTML_QuickForm_mdate extends HTML_QuickForm_date else { return null; } - } // end func _createNumericOptionList -} + } // end func getValue + + /** + * Verifica que una fecha sea valida. + * + * Verifica que una fecha sea valida. El formato siempre debe ser + * '%Y-%m-%d' + * + * @access public + * @return bool + */ + function validate($fecha) + { + return Validate::date($fecha, array('format' => '%Y-%m-%d')) + } // end func validate ?> -- 2.43.0