X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/c7b69266564b1e8b32109bd2cf6b244ffaf58d05..02fac79a27bdb3b710ab2a430f178bf295f7081b:/HTML/php/QuickForm/mdate.php diff --git a/HTML/php/QuickForm/mdate.php b/HTML/php/QuickForm/mdate.php index 4fe0e42..1c528bc 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,21 @@ 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($nombre, $valor, $formato = '') + { + $tmp = $valor['F'].'-'.$valor['d'].'-'.$valor['Y']; + return Validate::date($tmp, array('format' => '%Y-%m-%d')); + } // end func validate } ?>