0

I have a Time component in my webform. When I go to my form I see Hour is selected by default in the Hour field but I see 00 is selected by default in the Minute field.

How I can set Minute as the default value in the Minute field?

1

As the time component says in its description field, it "accepts a time in any GNU Date Input Format. Strings such as now, +2 hours, and 10:30pm are all valid."

If you want to set the default minute, you can used a formatted string like "1972-09-24T20:02:00,000000-0500" or "10:30pm" in the Default value field.

0

I believe this is due to a bug I just reported here: https://www.drupal.org/node/2663960

Try to modify the following file: sites/all/modules/webform/components/time.inc by looking for:

$default_values = array(
  'hour' => '',
  'minute' => '0',
  'second' => '',
);

(line 191) and change it to:

$default_values = array(
  'hour' => '',
  'minute' => '',
  'second' => '',
);

Keep your eye on the link I posted above to see the official resolution of this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.