Hi. Thanks for a great module. There is some problem. During the search an error

    Warning: date_timezone_set() expects parameter 1 to be DateTime, boolean given in format_date() (line 1909 of /srv/http/hors/includes/common.inc).
    Warning: date_format() expects parameter 1 to be DateTime, boolean given in format_date() (line 1919 of /srv/http/hors/includes/common.inc).

Besides sorting by date is displayed as a Unix time. Used by sorting on the field created by the module date 7.x-2.0-alpha4. I would be grateful for the help

CommentFileSizeAuthor
2011-11-17-151928_1440x900_scrot.png286.55 KBkorzh-nick

Comments

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

Not sure if this is related to the module? Maybe check your node/fields/entity for breaking the date function somehow.

korzh-nick’s picture

I do not know. But the facet display "links" or "links with checkboxes" functioning normally

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Active

Ok, try the following. I added the date query type in search_api_ranges_facetapi_widgets().

/**
 * Implements hook_facetapi_widgets().
 */
function search_api_ranges_facetapi_widgets() {
  return array(
    'search_api_ranges_ui_slider' => array(
      'handler' => array(
        'label' => t('Ranges: Min/Max UI Slider'),
        'class' => 'SearchApiRangesWidgetUISlider',
        'query types' => array(
          'term',
          'date',
        ),
      ),
    ),
  );
}

Let me know if this has any influence?

korzh-nick’s picture

It's a pity, but with the same result. Another observation - error when searching for words in Cyrillic. But the sorting time is Unix.

Anonymous’s picture

So it's related to the format_date() function. Can you see where you call this function?

>> Besides sorting by date is displayed as a Unix time
Yes it is, it has to sort by the unix value. The module is not a perfect date slider, it can only slide numerical values like a Unix timestamp.

Lakeside’s picture

Just activated the module on a fresh install of Drupal 7. Identical error.

Anonymous’s picture

Status: Active » Postponed

This module does not (yet) support date sliders, only integers/floats/decimals. Postponing until then.

jtbayly’s picture

Any plans to support dates, or is that just theoretical for now?

Thanks,
-Joseph

batje’s picture

second #8

Anonymous’s picture

I have no plans for dates, but if anyone supplies a patch, I will commit it.

My thoughts on the subject:

- the jQuery UI sliders can only slide integers (e.g. unix timestamps will work)
- implement date-pickers instead of regular input boxes?
- date slider could be extended in plugins/facetapi/widget_links.inc
- use some kind of preprocessing to represent timestamps as date_format (widget configuration option?)

Anonymous’s picture

Status: Postponed » Closed (works as designed)

Dates are supported, as long as you index dates as Unix timestamps. Then using the custom tpl.php file to theme your slider, change the text inputs to date-pickers that return a Unix timstamp.