Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / tests / modules / ajax_forms_test / src / Callbacks.php
index 9b35ef7694fc921b13249c28497b462ea0558ce9..71350305ffee40430a1dc791e911e20bbe1be09b 100644 (file)
@@ -27,7 +27,8 @@ class Callbacks {
    */
   public function dateCallback($form, FormStateInterface $form_state) {
     $response = new AjaxResponse();
-    $response->addCommand(new HtmlCommand('#ajax_date_value', $form_state->getValue('date')));
+    $date = $form_state->getValue('date');
+    $response->addCommand(new HtmlCommand('#ajax_date_value', sprintf('<div>%s</div>', $date)));
     $response->addCommand(new DataCommand('#ajax_date_value', 'form_state_value_date', $form_state->getValue('date')));
     return $response;
   }
@@ -39,7 +40,7 @@ class Callbacks {
     $datetime = $form_state->getValue('datetime')['date'] . ' ' . $form_state->getValue('datetime')['time'];
 
     $response = new AjaxResponse();
-    $response->addCommand(new HtmlCommand('#ajax_datetime_value', $datetime));
+    $response->addCommand(new HtmlCommand('#ajax_datetime_value', sprintf('<div>%s</div>', $datetime)));
     $response->addCommand(new DataCommand('#ajax_datetime_value', 'form_state_value_datetime', $datetime));
     return $response;
   }