Commit b40d0b6a authored by David Lesieur's avatar David Lesieur

Fixed unwanted timezone conversion for datestamps.

parent dc060631
......@@ -10,6 +10,7 @@ module_load_include('inc', 'cck_facets');
// TODO: Support 'todate' column.
// TODO: Timezone handling.
// TODO: Support for CCK Date granularity.
/**
* Implementation of hook_cck_facets_collect().
......@@ -73,9 +74,10 @@ function date_facets_cck_facets_collect(&$facets, $field, $domain, $env, $arg =
// Iterate through the field's multiple values.
foreach ($arg->{$field['field_name']} as $item) {
$timestamp = array_shift($item); // Take the item's main column.
$year = gmdate('Y', $timestamp);
$month = gmdate('n', $timestamp);
$day = gmdate('j', $timestamp);
$date = date_make_date($timestamp, $field['timezone_db'], $field['type'], $field['granularity']);
$year = date_format_date($date, 'custom', 'Y');
$month = date_format_date($date, 'custom', 'n');
$day = date_format_date($date, 'custom', 'j');
$active_path = array(
new datestamp_facet_category($field, $year, NULL, NULL),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment