Topic on Extension talk:Semantic Forms Inputs

Datepicker error: Undefined offset: -1 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 287

1
Zabien (talkcontribs)

Hello,

I get this datepicker error on two wikis, running on 1.23.1 /SFI 0.9.0 alpha and 1.23.6 / SFI 0.7.

  • Undefined offset: 0 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 283
  • Undefined offset: -1 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 287

The corresponding lines in the PHP file are about the minDate and maxDate.

281 // correct min/max date to the first/last allowed value
282 				if ( !$minDate || $minDate < $enabledDates[0][0] ) {
283 					$minDate = $enabledDates[0][0];
284 				}
285 
286 				if ( !$maxDate || $maxDate > $enabledDates[count( $enabledDates ) - 1][1] ) {
287 					$maxDate = $enabledDates[count( $enabledDates ) - 1][1];

I can acces, fill in and save the form, but would quite like to get rid of the error message. I have taken out the "data format" part, but with no effect. Any ideas what I could do to fix this error?

Reply to "Datepicker error: Undefined offset: -1 in [...]/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php on line 287"