Index: trunk/extensions/SemanticFormsInputs/SFI_Inputs.php |
— | — | @@ -908,11 +908,22 @@ |
909 | 909 | // insert the code of the JS init function into the pages code |
910 | 910 | $wgOut->addScript('<script type="text/javascript">' . $jstext . '</script>'); |
911 | 911 | |
| 912 | + // find allowed values and keep only the date portion |
| 913 | + if ( array_key_exists( 'possible_values', $other_args ) && |
| 914 | + count( $other_args[ 'possible_values' ] ) ) { |
| 915 | + |
| 916 | + $other_args[ 'possible_values' ] = preg_replace( |
| 917 | + '/^\s*(\d{4}\/\d{2}\/\d{2}).*/', |
| 918 | + '$1', |
| 919 | + $other_args[ 'possible_values' ] |
| 920 | + ); |
| 921 | + } |
| 922 | + |
912 | 923 | $separator = strpos($cur_value, " "); |
913 | 924 | |
914 | 925 | $html = '<span class="inputSpan' . ($is_mandatory ? ' mandatoryFieldSpan' : '') . '">' . |
915 | | - self::jqDatePickerHTML(substr($cur_value, 0, $separator), $input_name, $is_mandatory, $is_disabled, $other_args) . " " . |
916 | | - self::timepickerHTML(substr($cur_value, $separator + 1), $input_name, $is_mandatory, $is_disabled, $other_args) . |
| 926 | + self::jqDatePickerHTML(substr($cur_value + " ", 0, $separator), $input_name, $is_mandatory, $is_disabled, $other_args) . " " . |
| 927 | + self::timepickerHTML(substr($cur_value + " ", $separator + 1), $input_name, $is_mandatory, $is_disabled, $other_args) . |
917 | 928 | Xml::element("input", |
918 | 929 | array( |
919 | 930 | "id" => "input_{$sfgFieldNum}", |
— | — | @@ -1059,7 +1070,7 @@ |
1060 | 1071 | 'class' => 'createboxInput ' . $userClasses, |
1061 | 1072 | 'name' => "button", |
1062 | 1073 | ) ) |
1063 | | - . "onclick=\"document.getElementById(this.id.replace('_button','_tp_show')).focus();\"" |
| 1074 | + . " onclick=\"document.getElementById(this.id.replace('_button','_tp_show')).focus();\"" |
1064 | 1075 | . ">" |
1065 | 1076 | |
1066 | 1077 | . Xml::element( |
— | — | @@ -1104,7 +1115,7 @@ |
1105 | 1116 | 'class' => 'createboxInput ' . $userClasses, |
1106 | 1117 | 'name' => "resetbutton", |
1107 | 1118 | ) ) |
1108 | | - . "onclick=\"document.getElementById(this.id.replace('_resetbutton','')).value='';" |
| 1119 | + . " onclick=\"document.getElementById(this.id.replace('_resetbutton','')).value='';" |
1109 | 1120 | . "document.getElementById(this.id.replace('_resetbutton','_tp_show')).value='';\"" |
1110 | 1121 | . ">" |
1111 | 1122 | |