From: Martín Marrese Date: Tue, 24 Jun 2003 16:49:42 +0000 (+0000) Subject: - Fix de un bug de la funcion que valida las fechas. Si le llegaban los datos vacios... X-Git-Tag: svn_import~458 X-Git-Url: https://git.llucax.com/mecon/meconlib.git/commitdiff_plain/0520607cdb3e5d7347ed08bfe8c2a4dfaeefee15?ds=sidebyside - Fix de un bug de la funcion que valida las fechas. Si le llegaban los datos vacios ('') la tomaba como no valida --- diff --git a/lib/MECON/HTML/QuickForm/mdate.php b/lib/MECON/HTML/QuickForm/mdate.php index 2697234..b1fb915 100644 --- a/lib/MECON/HTML/QuickForm/mdate.php +++ b/lib/MECON/HTML/QuickForm/mdate.php @@ -119,8 +119,8 @@ class HTML_QuickForm_mdate extends HTML_QuickForm_date function validate($valor, $nombre, $formato = '') { $str = sprintf ("%4d-%02d-%02d",$valor['Y'],$valor['F'],$valor['d']); - - if ($valor['Y'] != '--' && $valor['d'] != '--' && $valor['F'] != '--') { + + if (($valor['Y'] != '--' && $valor['d'] != '--' && $valor['F'] != '--') && ($valor['Y'] != '' && $valor['d'] != '' && $valor['F'] != '')) { return Validate::date($str, array('format' => '%Y-%m-%d')); } return true;