Commit 44965b37 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Allow setting of the date/time format by users of the calendar element.

parent 12876f24
......@@ -62,9 +62,9 @@ function pieform_render_calendar_set_attributes($element) {
$element['jsroot'] = isset($element['jsroot']) ? $element['jsroot'] : '';
$element['language'] = isset($element['language']) ? $element['language'] : 'en';
$element['theme'] = isset($element['theme']) ? $element['theme'] : 'calendar-win2k-2';
$element['caloptions']['ifFormat'] = '%Y/%m/%d';
$element['caloptions']['daFormat'] = '%Y/%m/%d';
$element['rules']['regex'] = '#^(\d{4}/\d{2}/\d{2})?$#';
$element['caloptions']['ifFormat'] = isset($element['caloptions']['ifFormat']) ? $element['caloptions']['ifFormat'] : '%Y/%m/%d';
$element['caloptions']['daFormat'] = isset($element['caloptions']['daFormat']) ? $element['caloptions']['daFormat'] : '%Y/%m/%d';
$element['rules']['regex'] = isset($element['rules']['regex']) ? $element['rules']['regex'] : '#^((\d{4}/\d{2}/\d{2})( \d{2}:\d{2})?)?$#';
return $element;
}
......
Supports Markdown
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