[dev] Form & select time

steve mailling at gmx.co.uk
Thu Feb 5 05:47:06 PST 2004


Here is a patch to offer more options about what we are going to show:
RCS file: /repository/framework/Form/Form.php,v
retrieving revision 1.220
diff -w -b -r1.220 Form.php
2314c2314,2318
<             return array('hour' => '', 'minute' => '', 'second' => '');
---
 >             return array('hour' => '',
 >             'minute' => '',
 >             'second' => '',
 >             'stepMinute' => 1,
 >             'stepSecond' => 1);
2319c2323,2325
<                      'second' => $time->getSecond());
---
 >                      'second' => $time->getSecond(),
 >             		'stepMinute' => 1,
 >             		'stepSecond' => 1);



And
RCS file: /repository/framework/UI/UI/VarRenderer/html.php,v
retrieving revision 1.15
diff -w -b -r1.15 html.php
259a260,263
 >         $time = $var->type->getTimeParts($var->getValue($vars, $index));
 >         $stepMinutes = isset($time['stepMinute'])?	$time['stepMinute']:	1;
 >         $stepSeconds = isset($time['stepSecond'])?	$time['stepSecond']:	1;
 >
260a265,269
 > 		if ($stepMinutes < 60)
 > 	        $minutes = array('' => _("MM"));
 > 		if ($stepSeconds < 60)
 > 	        $seconds = array('' => _("SS"));
 >
264,265c273
<         $minutes = array('' => _("MM"));
<         for ($i = 0; $i <= 59; $i++) {
---
 >         for ($i = 0; $i <= 59; $i=$i+$stepMinutes) {
268,269c276
<         $seconds = array('' => _("SS"));
<         for ($i = 0; $i <= 59; $i++) {
---
 >         for ($i = 0; $i <= 59; $i=$i+$stepSeconds) {
272d278
<         $time = $var->type->getTimeParts($var->getValue($vars, $index));



More information about the dev mailing list