2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2003 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Martin Marrese
17 // | Date: jue jun 5 17:59:44 ART 2003
18 // +----------------------------------------------------------------------+
30 require_once('HTML/QuickForm/date.php');
31 require_once('Date.php');
34 * Class to dynamically create HTML Select elements from a date
35 * Modificado para que cumpla con los requisitos de mecon
38 class HTML_QuickForm_mdate extends HTML_QuickForm_date
45 * @param string $elementName (optional)Input field name attribute
46 * @param string $value (optional)Input field value
47 * @param mixed $attributes (optional)Either a typical HTML attribute string
48 * or an associative array. Date format is passed along the attributes.
52 function HTML_QuickForm_mdate($elementName=null, $elementLabel=null, $options=array(), $attributes=null)
54 $this->_options = array ('es' => array (
55 'weekdays_short'=> array ('--' => '--', 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'),
56 'weekdays_long' => array ('--' => '--', 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'),
57 'months_short' => array ('--' => '--', 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'),
58 'months_long' => array ('--' => '--', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septimbre', 'Octubre', 'Noviembre', 'Diciembre')
62 parent::HTML_QuickForm_date($elementName, $elementLabel, $options, $attributes);
66 // {{{ _createNumericOptionList()
69 * Creates a numeric option list based on a start number and end number
71 * @param int $start The start number
72 * @param int $end The end number
75 * @return array An array of numeric options.
77 function _createNumericOptionList($start, $end)
81 //Verificar que esto este funcionando bien.
82 $options['--'] = '--';
84 for ($i = $start; $i <= $end; $i++) {
85 $options[$i] = sprintf('%02d', $i);
90 } // end func _createNumericOptionList
93 * Devuelve un objeto date
97 * @return object Date.
101 if ($this->_selectedDate['Y'] != 00) {
102 return new Date (sprintf("%04d-%02d-%02d 00:00:00",$this->_selectedDate['Y'],$this->_selectedDate['F'],$this->_selectedDate['d']));
107 } // end func _createNumericOptionList