1

I'm using Availability Calendars and Date API modules and I need to filter views using the availability data. The module provides a view exposed filter which allows to choose an arrival and a departure dates. The problem is that when a date is chosen in the filter and the request is sent, a warning message appears saying:

The value input for field Arrival date is invalid: The value 11 does not match the expected format.

Its using the d/m/Y (15/02/2016) format in the field. If i change the parameters sent via GET in the url to Y-m-d format (2016-02-15) the message changes a little bit but still not working:

The value input for field Arrival date is invalid: The value 2016-02-5 00:00 does not match the expected format. The value input for field Departure date is invalid: The value 2016-02-15 00:00 does not match the expected format.

When I check the Drupal logs, the error messages point to Date API module:

Warning: strlen() expects parameter 1 to be string, array given in date_default_date() (line 115 of /var/www/vhosts/drupal/litoral.interdigital.biz/sites/all/modules/date/date_api/date_api_elements.inc).

Warning: strlen() expects parameter 1 to be string, array given in date_default_date() (line 114 of /var/www/vhosts/drupal/litoral.interdigital.biz/sites/all/modules/date/date_api/date_api_elements.inc).

Notice: Undefined index: time in date_popup_input_date() (line 626 of /var/www/vhosts/drupal/litoral.interdigital.biz/sites/all/modules/date/date_popup/date_popup.module).

The first two warnings appear twice every time a request is sent which looks like they're triggered by both arrival and departure dates. The last one occurs only once.

I've been Googling for the problem and I found some references to invalid dates and Date API but they weren't very useful to me. I tried to define date formats in the as shown in: https://www.drupal.org/node/2243009 but nothing happened.

Edit:

I followed the issue to the date_api.module and the parse function (line 596). That function defines the error message "The value 2016-02-15 00:00 does not match the expected format" . from here I coukld obtain the $format parameter of this function and I've seen that it's "Y", I tried to pass years as GET parameters for the function but still nothing. If i force the $format to be "d/m/Y" or "Y-m-d" the message changes to:

The value input for field Arrival date is invalid.

The value 2016-02-15 00:00 does not match the expected format.

The day is missing.

The month is missing.

The year is missing.

The hour is missing.

The minute is missing.

The value input for field Departure date is invalid.

The value 2016-02-15 00:00 does not match the expected format.

The day is missing.

The month is missing.

The year is missing.

The hour is missing.

The minute is missing.

Your Answer

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

Browse other questions tagged or ask your own question.