Timezone support for Date Facets
fletch11 - May 13, 2009 - 08:47
| Project: | CCK Facets |
| Version: | 6.x-1.x-dev |
| Component: | Date Facets |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
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.

#1
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
#6
@fletch11: Sorry, your issue has been hijacked. :-)
#7
No problem... I welcome the assault.