Active
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2013 at 12:34 UTC
Updated:
2 Apr 2013 at 12:34 UTC
The date filter uses 0 (epoch) as the starting point for date calculations. This is completely incorrect:
$value = intval(strtotime($this->value['value'], 0));
The real example: filtering nodes created in the current year. The obvious filter is:
creation date >= '1/1'
See the result:
strtotime('1/1', 0) = -10800
strtotime('1/1') = 1356984000
Even date offset filter is broken, you can see the difference between the proper calculation and the calculation used by Views module:
print date('c', strtotime('+100 years'));
print date('c', strtotime('now') + strtotime('+100 years', 0));