X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/cacc1525e7102dfef7964462a50e4ff13f02dcc6..556d7550dd118fcf4d4ad9944c506b1d73d51d03:/lib/MECON/HTML/QuickForm/mdate.php 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