X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/cacc1525e7102dfef7964462a50e4ff13f02dcc6..46e1d55b1437c3eb73a9d877d9faae2979263639:/lib/MECON/HTML/QuickForm/mdate.php?ds=inline diff --git a/lib/MECON/HTML/QuickForm/mdate.php b/lib/MECON/HTML/QuickForm/mdate.php index de9c54b..b1fb915 100644 --- a/lib/MECON/HTML/QuickForm/mdate.php +++ b/lib/MECON/HTML/QuickForm/mdate.php @@ -118,8 +118,10 @@ class HTML_QuickForm_mdate extends HTML_QuickForm_date */ function validate($valor, $nombre, $formato = '') { - if ($valor['Y'] != '--' && $valor['d'] != '--' && $valor['F'] != '--') { - return Validate::date($valor['Y'].'-'.$valor['d'].'-'.$valor['F'], array('format' => '%Y-%m-%d')); + $str = sprintf ("%4d-%02d-%02d",$valor['Y'],$valor['F'],$valor['d']); + + if (($valor['Y'] != '--' && $valor['d'] != '--' && $valor['F'] != '--') && ($valor['Y'] != '' && $valor['d'] != '' && $valor['F'] != '')) { + return Validate::date($str, array('format' => '%Y-%m-%d')); } return true; } // end func validate