mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
meridian function
This commit is contained in:
parent
6d97aedd47
commit
a876c77987
2 changed files with 5 additions and 5 deletions
|
@ -1711,15 +1711,14 @@ class FormHelper extends AppHelper {
|
|||
* that string is displayed as the empty element.
|
||||
*
|
||||
* @param string $fieldName Prefix name for the SELECT element
|
||||
* @param string $selected Option which is selected.
|
||||
* @param string $attributes Array of Attributes
|
||||
* @param bool $showEmpty Show/Hide an empty option
|
||||
* @return string Completed meridian select input
|
||||
* @access public
|
||||
* @link http://book.cakephp.org/view/1422/meridian
|
||||
*/
|
||||
public function meridian($fieldName, $selected = null, $attributes = array()) {
|
||||
$attributes += array('empty' => true, 'value' => $selected);
|
||||
public function meridian($fieldName, $attributes = array()) {
|
||||
$attributes += array('empty' => true, 'value' => null);
|
||||
if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) {
|
||||
if (is_array($value)) {
|
||||
extract($value);
|
||||
|
@ -1907,9 +1906,10 @@ class FormHelper extends AppHelper {
|
|||
case '12':
|
||||
$selectHourAttr['value'] = $hour;
|
||||
$selectMinuteAttr['value'] = $min;
|
||||
$selectMeridianAttr['value'] = $meridian;
|
||||
$opt .= $this->hour($fieldName, false, $selectHourAttr) . ':' .
|
||||
$this->minute($fieldName, $selectMinuteAttr) . ' ' .
|
||||
$this->meridian($fieldName, $meridian, $selectMeridianAttr);
|
||||
$this->meridian($fieldName, $selectMeridianAttr);
|
||||
break;
|
||||
default:
|
||||
$opt .= '';
|
||||
|
|
|
@ -3901,7 +3901,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
date('a', $now),
|
||||
'/option',
|
||||
'*/select'
|
||||
);
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12');
|
||||
|
|
Loading…
Add table
Reference in a new issue