Commit b8206956 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Allow pieform date element to be set to Not Specified

parent 103bd6ac
......@@ -36,10 +36,10 @@ function pieform_element_date(Pieform $form, $element) {
$name = $element['name'];
$element['minyear'] = (isset($element['minyear'])) ? intval($element['minyear']) : 1950;
$element['maxyear'] = (isset($element['maxyear'])) ? intval($element['maxyear']) : 2050;
if (!isset($element['defaultvalue'])) {
$required = (!empty($element['rules']['required']));
if ($required && !isset($element['defaultvalue'])) {
$element['defaultvalue'] = time();
}
$required = (!empty($element['rules']['required']));
// Year
$value = pieform_element_date_get_timeperiod_value('year', $element['minyear'], $element['maxyear'], $element, $form);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment