X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/6afa6384d2745cdd3de0d3a00c7b3ef06c2b9f98..ab08e58537352a82e34dab0684ae5997ece1899c:/lib/MECON/HTML/QuickForm/mdate.php?ds=sidebyside diff --git a/lib/MECON/HTML/QuickForm/mdate.php b/lib/MECON/HTML/QuickForm/mdate.php index e454287..3c28d14 100644 --- a/lib/MECON/HTML/QuickForm/mdate.php +++ b/lib/MECON/HTML/QuickForm/mdate.php @@ -90,11 +90,11 @@ class MECON_HTML_QuickForm_mdate extends HTML_QuickForm_date { $date = parent::getValue(); - if ($date['Y']) { + if ($date['Y'][0]) { return new Date (@sprintf("%04d-%02d-%02d %02d:%02d:00", - $date['Y'], $date['F'], - $date['d'], $date['H'], - $date['i'])); + $date['Y'][0], $date['F'][0], + $date['d'][0], $date['H'][0], + $date['i'][0])); } else { return null; } @@ -110,7 +110,7 @@ class MECON_HTML_QuickForm_mdate extends HTML_QuickForm_date { * @return bool */ function validate($valor, $nombre, $formato = '') { - // Si viene completamente lleno, se valida con el paquete Validate. + // Si viene completamente lleno, se valida con el paquete Validate if ($valor['Y'] and $valor['d'] and $valor['F']) { $str = sprintf('%4d-%02d-%02d', $valor['Y'], $valor['F'], $valor['d']); return Validate::date($str, array('format' => '%Y-%m-%d'));