Project:CCK Facets
Version:6.x-1.x-dev
Component:Date Facets
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

I was just wondering if anyone out there has looked into creating a date facet module based on the date module? I would if I could but it would be nice to search by, for example, starting date of an event.

Comments

#1

Status:active» fixed

Yes, see CCK Facets.

#2

However it's not very useful due to no timezone support

#3

Thanks David. I don't need timezone support so this is perfect.

#4

@jpp: Help is welcome to develop the module further. :-)

#5

I'm slammed with work however I did hack timezone support a while back

basically I added a call to the get_timezone code in date_authored_facet (why re-invent the wheel :-)

     *   The query object to update.
     */
    function build_results_query(&$query) {
+     $timezone = _date_authored_facet_get_user_timezone(); // hack !
      $db_info = _cck_facets_db_info($this->_field);
      $main_column = array_shift($db_info['columns']);
      // Since the same table might be joined multiple times in the query, we use
***************

and then added "+ $timezone" to all the places where a date is being added to the query

$query->add_where("($table.${main_column['column']} + $timezone >= UNIX_TIMESTAMP($from))");

There are about 20 similar lines - I'd send a patch but my hacked version is 2 revs back from the current dev and I don't have time to untangle the changes.

Hacked file attached - use extreme cautuon it's not the current version

AttachmentSize
date_facets.module.zip 3.36 KB

#6

Title:Date facet?» Timezone support for Date Facets
Project:Faceted Search» CCK Facets
Version:6.x-1.x-dev» 6.x-1.x-dev
Component:Miscellaneous» Date Facets
Status:fixed» needs work

@fletch11: Sorry, your issue has been hijacked. :-)

#7

No problem... I welcome the assault.

#8

I don't know if that can help, but we met problems of timezone on our site and found this solution :
http://drupalfr.org/forum/support/developpement/27462-cck-date-et-cck-fa...
Thank you for your work, this is a very useful module!
Brn

nobody click here