* @return object Date.
*/
function &getValue() {
- if ($this->_selectedDate['Y']) {
+
+ $date = parent::getValue();
+
+ if ($date['Y'][0]) {
return new Date (@sprintf("%04d-%02d-%02d %02d:%02d:00",
- $this->_selectedDate['Y'], $this->_selectedDate['F'],
- $this->_selectedDate['d'], $this->_selectedDate['H'],
- $this->_selectedDate['i']));
+ $date['Y'][0], $date['F'][0],
+ $date['d'][0], $date['H'][0],
+ $date['i'][0]));
} else {
return null;
}
* @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'));