Loading core/lib/Drupal/Core/Render/Element/Date.php +2 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ public function getInfo() { '#process' => [[$class, 'processDate']], '#pre_render' => [[$class, 'preRenderDate']], '#theme_wrappers' => ['form_element'], '#attributes' => ['type' => 'date'], '#date_date_format' => 'Y-m-d', ]; } Loading core/modules/system/src/Tests/Form/FormTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -533,7 +533,7 @@ function testDisabledElements() { // All the elements should be marked as disabled, including the ones below // the disabled container. $actual_count = count($disabled_elements); $expected_count = 41; $expected_count = 42; $this->assertEqual($actual_count, $expected_count, SafeMarkup::format('Found @actual elements with disabled property (expected @expected).', array( '@actual' => count($disabled_elements), '@expected' => $expected_count, Loading core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php +9 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,15 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#date_timezone' => 'Europe/Berlin', ); $form['disabled_container']['disabled_container_date'] = array( '#type' => 'date', '#title' => 'date', '#default_value' => '2001-01-13', '#expected_value' => '2001-01-13', '#test_hijack_value' => '2013-01-01', '#date_timezone' => 'Europe/Berlin', ); // Try to hijack the email field with a valid email. $form['disabled_container']['disabled_container_email'] = array( Loading Loading
core/lib/Drupal/Core/Render/Element/Date.php +2 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ public function getInfo() { '#process' => [[$class, 'processDate']], '#pre_render' => [[$class, 'preRenderDate']], '#theme_wrappers' => ['form_element'], '#attributes' => ['type' => 'date'], '#date_date_format' => 'Y-m-d', ]; } Loading
core/modules/system/src/Tests/Form/FormTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -533,7 +533,7 @@ function testDisabledElements() { // All the elements should be marked as disabled, including the ones below // the disabled container. $actual_count = count($disabled_elements); $expected_count = 41; $expected_count = 42; $this->assertEqual($actual_count, $expected_count, SafeMarkup::format('Found @actual elements with disabled property (expected @expected).', array( '@actual' => count($disabled_elements), '@expected' => $expected_count, Loading
core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php +9 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,15 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#date_timezone' => 'Europe/Berlin', ); $form['disabled_container']['disabled_container_date'] = array( '#type' => 'date', '#title' => 'date', '#default_value' => '2001-01-13', '#expected_value' => '2001-01-13', '#test_hijack_value' => '2013-01-01', '#date_timezone' => 'Europe/Berlin', ); // Try to hijack the email field with a valid email. $form['disabled_container']['disabled_container_email'] = array( Loading