mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Merge branch '1.3' of git://github.com/cakephp/cakephp into 1.3
This commit is contained in:
commit
5c18571db1
2 changed files with 19 additions and 5 deletions
|
@ -1832,9 +1832,8 @@ class FormHelper extends AppHelper {
|
||||||
|
|
||||||
if (!empty($timeFormat)) {
|
if (!empty($timeFormat)) {
|
||||||
$time = explode(':', $days[1]);
|
$time = explode(':', $days[1]);
|
||||||
$check = str_replace(':', '', $days[1]);
|
|
||||||
|
|
||||||
if (($check > 115959) && $timeFormat == '12') {
|
if (($time[0] > 12) && $timeFormat == '12') {
|
||||||
$time[0] = $time[0] - 12;
|
$time[0] = $time[0] - 12;
|
||||||
$meridian = 'pm';
|
$meridian = 'pm';
|
||||||
} elseif ($time[0] == '00' && $timeFormat == '12') {
|
} elseif ($time[0] == '00' && $timeFormat == '12') {
|
||||||
|
|
|
@ -1887,11 +1887,10 @@ class FormHelperTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test form->input() with datetime, date and time types
|
* test form->input() with time types.
|
||||||
*
|
*
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
function testInputDatetime() {
|
function testInputTime() {
|
||||||
extract($this->dateRegex);
|
extract($this->dateRegex);
|
||||||
$result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24));
|
$result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24));
|
||||||
$result = explode(':', $result);
|
$result = explode(':', $result);
|
||||||
|
@ -1929,6 +1928,22 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertPattern('#<option value="15"[^>]*>15</option>#', $result[1]);
|
$this->assertPattern('#<option value="15"[^>]*>15</option>#', $result[1]);
|
||||||
$this->assertPattern('#<option value="30"[^>]*>30</option>#', $result[1]);
|
$this->assertPattern('#<option value="30"[^>]*>30</option>#', $result[1]);
|
||||||
|
|
||||||
|
$result = $this->Form->input('Random.start_time', array(
|
||||||
|
'type' => 'time',
|
||||||
|
'selected' => '18:15'
|
||||||
|
));
|
||||||
|
$this->assertPattern('#<option value="06"[^>]*>6</option>#', $result);
|
||||||
|
$this->assertPattern('#<option value="15"[^>]*>15</option>#', $result);
|
||||||
|
$this->assertPattern('#<option value="pm"[^>]*>pm</option>#', $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test form->input() with datetime, date and time types
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function testInputDatetime() {
|
||||||
|
extract($this->dateRegex);
|
||||||
$result = $this->Form->input('prueba', array(
|
$result = $this->Form->input('prueba', array(
|
||||||
'type' => 'datetime', 'timeFormat'=> 24 , 'dateFormat'=>'DMY' , 'minYear' => 2008,
|
'type' => 'datetime', 'timeFormat'=> 24 , 'dateFormat'=>'DMY' , 'minYear' => 2008,
|
||||||
'maxYear' => date('Y') + 1 ,'interval' => 15
|
'maxYear' => date('Y') + 1 ,'interval' => 15
|
||||||
|
|
Loading…
Add table
Reference in a new issue