I just updated to 6.x-2.1 and my views filter doesn't work anymore. It looks like everything is displayed instead of "future" event that the filter is supposed to do.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Torenware’s picture

What exactly are you trying to get here?

  • What range of dates/times do you want to filter?
  • What text are you entering (and where in the UI are you entering it).

There are a couple of possibilities here, depending upon what you want and what you're currently doing.

maykbrito’s picture

same problem here!
I follow step-by-step those book (O'Reilly - Using Drupal. chapter 9). Then I just updated to 6.x-2.1 and my views filter doesn't work anymore.

mattyoung’s picture

I have a CCK type 'event' with a Date field. I have a view to display up coming event. So I have a filter on the 'date' field "Is greater than or equal to" now. Before I upgrade it used to work as expected. But after upgrade, it's as if 'now' is way back in the past and my up coming event is showing all the event from my very first old event.

I'm not all certain this is a Date module problem because I also just upgraded the Views module. Could this be a Views problem?

Torenware’s picture

OK, I have the book, so I took a look.

I have a theory on this one. Try the patch in comment #2 of #424006 and see if it helps you.

mattyoung’s picture

I went and look at #424006: Best way of getting today's events in list view and before I try the patch, I took a look at Views' Live Preview query output:

SELECT node.nid AS nid,
   node.title AS node_title,
   node_data_field_event_date.field_event_date_value AS node_data_field_event_date_field_event_date_value,
   node_data_field_event_date.field_event_date_value2 AS node_data_field_event_date_field_event_date_value2,
   node.type AS node_type,
   node.vid AS node_vid
 FROM node node 
 INNER JOIN users users ON node.uid = users.uid
 LEFT JOIN content_type_event node_data_field_event_date ON node.vid = node_data_field_event_date.vid
 WHERE node.type in ('event')
   ORDER BY node_data_field_event_date_field_event_date_value ASC

and notice the WHERE clause has no date filter. I deleted the filter and added it again and still the query came out the same. This could be a Views problem. I added a bug report in Views: #427936: Date filter doesn't work anymore: it's not in the where clause.

higherform’s picture

Saw the same issue when upgrade from 6.x-2.x-dev circa Mar 21 to 6.x-2.1. WHERE clause with the date >= now is not added to the sql statement. Clearing views cache, re-saving the date field I was filtering on, re-adding the filter all have no effect.

Rollback to the 6.x.-2.x-dev circa Mar 21 I had immediately clears up the problem.

Using views 6.x-2.4 btw.

jpetso’s picture

Yep, same here. When a concrete date is entered then the WHERE clause is generated, but when only the relative date is given then it misses from the query. Regression compared to 6.x-2.0, where this worked like a charm.

jpetso’s picture

@Torenware: The patch you mentioned does not resolve the issue.

jpetso’s picture

Checked the dev version (DRUPAL-6--2 branch from today, April 9) and this particular issue is fixed there.

jpetso’s picture

Status: Active » Fixed

Oops, I actually wanted to mark this issue as "fixed".

Gábor Hojtsy’s picture

Experienced the same. Upgrading to -dev solved the problem.

starbow’s picture

Note for anyone frustrated on this issue - remember to clear your cache after you upgrade.

HelloStephanie’s picture

Status: Fixed » Active

I am still having an issue with this despite following all of the steps above. The query code I'm generating is:

--------

SELECT node.nid AS nid,
node.title AS node_title,
node_data_field_event_date.field_event_date_value AS node_data_field_event_date_field_event_date_value,
node_data_field_event_date.field_event_date_value2 AS node_data_field_event_date_field_event_date_value2,
node_data_field_event_date.field_event_date_timezone AS node_data_field_event_date_field_event_date_timezone,
node_data_field_event_date.field_event_date_offset AS node_data_field_event_date_field_event_date_offset,
node_data_field_event_date.field_event_date_offset2 AS node_data_field_event_date_field_event_date_offset2,
node.type AS node_type,
node.vid AS node_vid
FROM node node
LEFT JOIN content_type_event node_data_field_event_date ON node.vid = node_data_field_event_date.vid
WHERE (node.type in ('event')) AND (node.status <> 0)
ORDER BY node_data_field_event_date_field_event_date_value ASC

---------

Notice that the WHERE clause is not filtering by date.

When I expose Date:Date everything works properly. When I hide Date:Date it's broken again.

I have been trying to fix this problem for a few days now and I cannot get it to work! Anyone have any ideas on what I can do to fix this? I've updated to the latest -dev of date, views, and cck

Kisama’s picture

Subscribing, I also have this problem. Unable to filter using relative dates. I have 6.x-2.1 installed. Cache is cleared and the views were built after that version was installed. I have even opened all my date fields.

mattyoung’s picture

#13, #14:

As others have indicated here, using the dev version solved this problem. Are you using the dev version?

HelloStephanie’s picture

I completely deleted all previous -dev and have intalled:

Date 6.x-2.1
Views 6.x-2.5
CCK 6.x-2.2

HelloStephanie’s picture

Status: Active » Fixed

Whoops! mattyoung, you're correct. It is fixed. I did not see there there was a 6.x-2.x-dev posted Apr-13.

Everything works now.

zmo’s picture

For me , the problem was that relative filters on the date field would not show up in the SQL query (whereas absolute ones did).
LIke said before, Installing the Date 6.x-2.x version (http://ftp.drupal.org/files/projects/date-6.x-2.x-dev.tar.gz) solved the problem.

steppek’s picture

I do have the Dev version installed and I am still seeing this problem. I don't see any date criteria in the SQL statement.
I have: Date: Date Content: Date Range (field_display_date_range) - From date >= now

and the SQL looks like this:
SELECT node.nid AS nid,
node.created AS node_created
FROM dru_node node
LEFT JOIN dru_comments comments ON node.nid = comments.nid
WHERE (node.type in ('dailybulletin')) AND (node.status <> 0)
ORDER BY node_created DESC

steppek’s picture

My Bad. I updated the Views module to dev....not Date as mentioned above. It is working now with Date dev. Thank you.

gdd’s picture

FileSize
7.61 KB

I made a patch for this issue, which doesn't require updating the whole dev version. Attached if anyone wants it.

robbiethegeek’s picture

Just wondering if there is an idea of this getting rolled into a release?

RobbieTheGeek

pam.pkrweb@gmail.com’s picture

Hi! I am having the same issue. I have same question. When will this get into a release?

Until release came someone explain how to install the patch file that is above?

Thank you
Pam

gdd’s picture

If you do not wish to install the patch, you can simply use the newest -dev release of Date.

jastylr’s picture

How do you select the "Is greater than" Operator option in the Views Filters? I am only able to have the "Is equal to" option.

I have downloaded the latest -dev version of the Date module and installed it on my site. I have created a new Event node type and added a required Date field called "Event Date" (field_event_date) that allows for an optional To date. I have the Default Display set to "Long" and the Time Zone handling set to "No time zone conversion".

I created a new page view and in the fields, I chose "Content: Event Date - From Date" along with the Node title and some other fields.

I then chose to add a new Filter and selected "Date: Date (node)" from the date options and chose "Content: Event Date (field_event_date) - From date" from the Date fields choices. The rest of the options I left as default.

When the filter configuration options appear, the only choice I have for the Operator: is "Is equal to" which expects me to enter either an absolute date or set defaults for a relative date.

How come I cannot choose an operator of "Is greater than" and then enter "now" in the Date default field?

As I mentioned, I have the latest development version of the Date module and my Drupal core and all other modules are currently up to date.

Any help would be appreciated.

jastylr’s picture

Also, even though I have set the output format of the Date field to long with 12 hour time format, my nodes show the dates in 24 hour time format. When I create the node, the dates are entered in 12 Hour format. So I enter 07:00PM but when the node is displayed, it shows 19:00PM.

J V’s picture

In release notes for 2.1 it says its fixed, but it isn't... Why? Can we expect 2.2 with a decent fix soon?

fletch11’s picture

latest dev version appears to work for me

markabur’s picture

Version: 6.x-2.1 » 6.x-2.x-dev
Status: Fixed » Active
FileSize
18.76 KB

i just updated to the latest dev and can't get date-based views filters to have any effect at all on my results. views that at one point showed only upcoming events now show everything. i've tried removing the filter and recreating it, with no change. below is the sql from two queries, with and without the date filter (the only difference s the inner join, for some reason). also notable is the fact that i have three seemingly-identical options in my date-filter select, see attached.

WITH date filter:

SELECT node.nid AS nid,
   node.title AS node_title,
   node_data_field_event_date.field_event_date_value AS node_data_field_event_date_field_event_date_value,
   node_data_field_event_date.field_event_date_value2 AS node_data_field_event_date_field_event_date_value2,
   node.type AS node_type,
   node.vid AS node_vid
 FROM node node 
 INNER JOIN users users ON node.uid = users.uid
 LEFT JOIN content_type_event node_data_field_event_date ON node.vid = node_data_field_event_date.vid
 WHERE (node.status <> 0) AND (node.type in ('event'))
   ORDER BY node_data_field_event_date_field_event_date_value DESC

WITHOUT date filter:

SELECT node.nid AS nid,
   node.title AS node_title,
   node_data_field_event_date.field_event_date_value AS node_data_field_event_date_field_event_date_value,
   node_data_field_event_date.field_event_date_value2 AS node_data_field_event_date_field_event_date_value2,
   node.type AS node_type,
   node.vid AS node_vid
 FROM node node 
 LEFT JOIN content_type_event node_data_field_event_date ON node.vid = node_data_field_event_date.vid
 WHERE (node.status <> 0) AND (node.type in ('event'))
   ORDER BY node_data_field_event_date_field_event_date_value DESC
markabur’s picture

fwiw to get my upcoming event block working again, i have gone back to 2.1, and applied the patch in #21. seems to work fine.

KarenS’s picture

Status: Active » Fixed

The patch in #21 is exactly what was already committed to -dev, so you have taken version 2.1 and adjusted it to match -dev, which is the version that is fixed. If -dev didn't work before, it is likely you had a bad value in a cache or something.

#21 I can't issue a release when people keep re-reporting that -dev is broken. I have to keep re-testing this over and over and over. If people would quit re-opening this issue I could do something about getting a release out.

DjebbZ’s picture

As KarenS (a.k.a the maintainer) says, the latest -dev works perfectly ! So install the latest -dev and use it until the next release ! Thanks guys for patching and developping !

cpill’s picture

Version: 6.x-2.x-dev » 6.x-2.1
Status: Fixed » Active

Just installed upgraded from 6.x-2.x-dev where this problem was fixed to 6.x-2.1. After running update.php the filter stopped working in the view. All nodes were showing when I just wanted

from: now
to: now + 4 weeks

Did this fix somehow not make it thought to the next version?

cpill’s picture

Status: Active » Fixed

opps, sorry, was looking at the wrong version number :P

robbiethegeek’s picture

Here is an exported view that is currently experiencing this issue. It is the block view using the relative time of Now

aaustin’s picture

The newest stable version and dev version are still not working for us either. If we expose the filter, it works correctly but for an upcoming events block, you don't want an exposed filter.

ultimateboy’s picture

Status: Fixed » Active

Tested on -dev release. Problem still exists.

KarenS’s picture

Status: Active » Fixed

I checked out #35 on a copy of his site and it is now working right in latest -dev. The report in #36 is way too vague for me to do anything with. 'The newest stable version' is not the version to test, we are testing -dev. I'm going to leave this marked fixed because it seems to be fixed for most and I need to get a new stable version released with these fixes.

aaustin’s picture

Sorry it was a miscommunication, my partner grabbed and installed the latest version of views.

cpill’s picture

Have you done an update.php? You have to revert your DB to before you installed 2.1 and then do the DEV versions update.php.

chadd’s picture

just updated to the latest date version (6.x-2.2) and the ">= now" still isn't working but i think it has to do with the date format string having an extra 'T' in it in the view filter.

(DATE_FORMAT(STR_TO_DATE(node_data_field_thing_date.field_thing_date_value, '%Y-%m-%dT%T'), '%Y-%m-%d') >= '2009-05-15')

shouldn't that be

(DATE_FORMAT(STR_TO_DATE(node_data_field_thing_date.field_thing_date_value, '%Y-%m-%d %T'), '%Y-%m-%d') >= '2009-05-15')

?

chadd’s picture

i changed line 178 of the date_api_sql.inc file and removed the extra T in the STR_TO_DATE function and now it works fine.

now i'm off to see why all my calendars disappeared :)

greg.harvey’s picture

Version: 6.x-2.1 » 6.x-2.2
Status: Fixed » Needs work

Re-opening, due to comment in #41. Proper patch required, I guess. Will test myself soon.

mikeybusiness’s picture

I saw that on http://drupal.org/node/465872 chadd had posted something similar. KarenS had answered it thusly:

That is not a bug. The raw code has to look like that to make it through Drupal's processing, where the extra '%' gets stripped out.

Several of the NOW features seem to have more to do with changes to the database or updates not being finished. In other words, people may have to run update.php more than once if all of the necessary changes don't happen because an update is required before a second update can happen.

Are you still having trouble? The troubleshooting information helped me. It's at the bottom of the default page. http://drupal.org/project/date

chadd’s picture

yes, she said the extra % char gets stripped out, but nobody ever said that the extra T should be there.

and when i removed the T, it started working fine.

Aldus’s picture

I am still facing this problem. Using the last stable (not dev) version of Date, and I'm trying to set the filter as > NOW (to show upcoming events). No way, in the views sql query there is no trace of this filter.
If I put a fixed date it appears correctly, so seems like it's NOW disturbing it.
Did someone come with a working solution?

Adeon’s picture

Having same issue with 5.x-2.x-dev

When using views it seems to think NOW = 2009-01-01 ..

So it screws up view results. I have logos that display in a date range, so its basicly showing old logos from the start of the year instead of the latest ones..

Please fix :) Im in a time warp!

hackwater’s picture

Subscribe

hackwater’s picture

Here's what I did to fix this:

1) Go to the content type with which you're having date/"now" issues
2) The granularity for my date field was Year/Month/Day, so I added Hour and Minute (you can probably get away with adding just Hour in this particular case)
3) Edit the view in question; under filters, for that date field, you should now have values that are set to 2009-01-01 00:00.
4) Select the blank/empty value for all those fields, and make sure you have "now" as your option.
5) Reset your granularity in the content type field settings to your original values.

I have no idea *why* this is happening, but I discovered, after doing a clean Drupal 5.18 install with stable CCK/Views and Date 5.x-2.7, that the field in the filter section of the view creation form had granularity options I wasn't seeing. I figured making a change to the field's granularity might at least elicit some reaction from either Views or Date; it seems that the "now" option is ignored precisely because there *are* values in those granularity options for the view field filter, but I don't know why these options were hidden in the first place or how they acquired their values.

greg.harvey’s picture

I have to say, I actually *tried* 6,x-2.2 today and didn't have any problems. For me it works right out of the box.

@chadd Could you provide a content type export and a view export for us to try elsewhere against 6.x-2.2?

alpapan’s picture

Status: Needs work » Needs review

Right... I just updated to the -dev version (current Drupal version) and run update.php a couple of times. I empty all my caches to be certain. I'm using postgres. The granularity of my content-type has year -> minutes in it.

I then create a query which looks like this by adding an absolute value to my date filter

SELECT node.nid AS nid,
node.title AS node_title,
node_data_field_eventstartdate.field_eventstartdate_value AS node_data_field_eventstartdate_field_eventstartdate_value,
node_data_field_eventstartdate.field_eventstartdate_value2 AS node_data_field_eventstartdate_field_eventstartdate_value2,
node.type AS node_type,
node.vid AS node_vid
FROM rfc_node node
LEFT JOIN rfc_content_type_event node_data_field_eventstartdate ON node.vid = node_data_field_eventstartdate.vid
INNER JOIN rfc_users users ON node.uid = users.uid
WHERE ((node.type in ('event')) AND (node.status <> 0 OR node.uid = ***CURRENT_USER*** or ***ADMINISTER_NODES*** = 1))
AND (TO_CHAR((node_data_field_eventstartdate.field_eventstartdate_value::ABSTIME + INTERVAL '3600 SECONDS'), 'YYYY-MM-DD') >= '2007-01-10')
ORDER BY node_data_field_eventstartdate_field_eventstartdate_value ASC

Note the custom date 2007-01-10. I then EDIT the filter to remove the absolute value and add the now option.

the query doesn't change.

If i delete the filter and recreate it directly with 'now' then this where option is missing complete:

I then install the development date module. Update.php, empty cache, remove filter, save view. Recreate filter.

Works fine.

Conclusion: you need the dev version of Views and Date. Update.php and empty your cache.

While debugging make sure the filter appears in the query field

Macronomicus’s picture

@chadd
That didnt seem to fix it for me :(

greg.harvey’s picture

*AHEM* See above ... ^^

If people having problems still actually attach their content types and views as exported code in txt files then it might give module devs something to work with... There could be a million reasons why any one individual instance of Date is not working, so without anything except for "didn't work for me" it's a needle in a haystack. And will be ignore or set to "maintainer needs more info".

Both the affected modules provide handy export features so someone can import your specific code and try it for themselves. Use them! =)

Macronomicus’s picture

FileSize
14.63 KB

@greg.harvey
I was letting chadd know his fix of removing the t did not work for me.

Ive attached the views export .. I'll have to look into the content type exports, I dont see any option in the gui to do that.

greg.harvey’s picture

@macrocosm: awesome, thanks! =)

Go to admin/content/types/export for CCK export. You need to enable the Content Copy module (comes with CCK) to have that link.

Macronomicus’s picture

@greg.harvey
For some reason there was something corrupt in my db .. once I uninstalled the modules and used the wizard again on top of my already existing date content type. I then moved over the old data/dates etc to my new date field. Everything is working as expected now! I have no idea what could have chewed it up, but its a happy camper now!

Thanks again for the tips on exports .. i'd not used those before, im sure they could be useful!

CHeers

andrew_hoffi’s picture

Version: 6.x-2.2 » 6.x-2.x-dev

I believe I'm getting the same problem and I've tried all of the points above and still receive no result.

I'm attempting to create a normal run of the mill events calendar using Date, Calendar and Views.

I have the latest dev version of Date and Stable version Views and Calendar installed. When I select the CCK date to be used as the argument of the View it does not bring up any results, when the Node Update date is used it works fine, but of course doesn't do what an events list should.

Its not the first time I've configured this set-up, but using the latest module releases it fails to work. So it leaves me to believe there is a problem with the module. Sorry guys I'm not that skilled to delve any further than the GUI.

arlinsandbulte’s picture

@hoffi:
Did you also add the CCK date to the fields of the view?
The way the calendar view works, the CCK date field must be added to both the argument of the view AND the field list.

This changed a little while ago. Earlier, the argument date field was automatically added to the views field list behind the scenes. That caused some other problems so Karen removed that 'feature.'
See this issue: #389294: Time Slot Calendar does not work

andrew_hoffi’s picture

Thank you very much, I was not aware of this change. Problem solved!

arlinsandbulte’s picture

Status: Needs review » Fixed

I'm going to mark this issue as fixed. I think the original issue IS fixed. There are some other questions above that may not be completely resolved.
This issue thread is way too long and confusing and polluted to continue in a constructive way.
If you have a related issue, please create another issue that can be more focused on your problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

stevenaburton’s picture

Version: 6.x-2.x-dev » 6.x-2.2
Status: Closed (fixed) » Active

This problems seems to be back. I have modified the field_event_date filter on the Upcoming block in 6.x 2.2, setting the operand to "greater than or equal to" and the value to "now". The following query is generated...

SELECT node.nid AS nid,
node.title AS node_title,
node.language AS node_language,
node_data_field_event_date.field_event_date_value AS node_data_field_event_date_field_event_date_value,
node_data_field_event_date.field_event_date_value2 AS node_data_field_event_date_field_event_date_value2,
node_data_field_event_date.field_event_date_rrule AS node_data_field_event_date_field_event_date_rrule,
node_data_field_event_date.delta AS node_data_field_event_date_delta,
node.type AS node_type,
node.vid AS node_vid
FROM node node
LEFT JOIN content_field_event_date node_data_field_event_date ON node.vid = node_data_field_event_date.vid
WHERE (node.status <> 0) AND (node.type in ('event')) AND (node_data_field_event_date.delta >= 0)
ORDER BY node_data_field_event_date_field_event_date_value ASC

As you can see, the where clause node_data_field_event_date.delta <= 0 is incorrect. I tried other value formats and other operands including less than, greater than and between. No matter what combination is chosen, the value is always "0".

scip’s picture

yurtboy’s picture

wow 5-13-10 3 hours later rolled back to http://ftp.drupal.org/files/projects/date-6.x-2.0.tar.gz
Oh well.
Thanks though far a great module! seriously how many hours would it have taken me to build this like 300.

Wish I could help on that bug.

kranicservin’s picture

Version: 6.x-2.2 » 6.x-2.4
Status: Active » Needs review
LSU_JBob’s picture

Status: Needs review » Needs work
FileSize
24.73 KB

This is also happening to me.

I installed the calendar module and one of the displays that comes with it is called 'Upcoming'. In my event content type, I have a CCK field I created called field_event_date. I configured the calendar view to use that cck field instead of the default node:last updated argument. I made the Filter do greater than or equal to, for field_event_date to be greater than or equal to "now".

Instead of the desired result, I get all events instead of events with field_event_date > NOW().

I tried using the dev version of date, no luck. I tried downgrading to date6.x-2.0 and that didn't work. Was thinking about trying to upgrade to views3...

I've attached an export of the view I'm using. It should be very similar to the view that comes with the calendar module except with some small overrides on my part.

Here is my drush sm.

 Package          Name                                            Type    Status         Version        
 Activity Stream  Activity Stream Core (activitystream)           Module  Enabled        6.x-2.0-beta1  
 Activity Stream  Delicious Bookmarks (activitystream_delicious)  Module  Not installed  6.x-2.0-beta1  
 Activity Stream  Digg (activitystream_digg)                      Module  Not installed  6.x-2.0-beta1  
 Activity Stream  Feed stream (activitystream_feed)               Module  Enabled        6.x-2.0-beta1  
 Activity Stream  Flickr Stream (activitystream_flickr)           Module  Not installed  6.x-2.0-beta1  
 Activity Stream  Last.fm (activitystream_lastfm)                 Module  Not installed  6.x-2.0-beta1  
 Activity Stream  Twitter (activitystream_twitter)                Module  Enabled        6.x-2.0-beta1  
 Administration   Admin (admin)                                   Module  Enabled        6.x-1.0-beta3  
 Administration   Administration menu (admin_menu)                Module  Enabled        6.x-1.5        
 CCK              Content (content)                               Module  Enabled        6.x-2.6        
 CCK              Content Copy (content_copy)                     Module  Enabled        6.x-2.6        
 CCK              Content Permissions (content_permissions)       Module  Not installed  6.x-2.6        
 CCK              Fieldgroup (fieldgroup)                         Module  Enabled        6.x-2.6        
 CCK              FileField (filefield)                           Module  Enabled        6.x-3.3        
 CCK              FileField Meta (filefield_meta)                 Module  Not installed  6.x-3.3        
 CCK              ImageField (imagefield)                         Module  Enabled        6.x-3.3        
 CCK              Node Reference (nodereference)                  Module  Enabled        6.x-2.6        
 CCK              Number (number)                                 Module  Enabled        6.x-2.6        
 CCK              Option Widgets (optionwidgets)                  Module  Enabled        6.x-2.6        
 CCK              Text (text)                                     Module  Enabled        6.x-2.6        
 CCK              User Reference (userreference)                  Module  Not installed  6.x-2.6        
 Core - optional  Aggregator (aggregator)                         Module  Not installed  6.16           
 Core - optional  Blog (blog)                                     Module  Not installed  6.16           
 Core - optional  Blog API (blogapi)                              Module  Not installed  6.16           
 Core - optional  Book (book)                                     Module  Not installed  6.16           
 Core - optional  Color (color)                                   Module  Enabled        6.16           
 Core - optional  Comment (comment)                               Module  Enabled        6.16           
 Core - optional  Contact (contact)                               Module  Not installed  6.16           
 Core - optional  Content translation (translation)               Module  Not installed  6.16           
 Core - optional  Database logging (dblog)                        Module  Enabled        6.16           
 Core - optional  Forum (forum)                                   Module  Not installed  6.16           
 Core - optional  Help (help)                                     Module  Enabled        6.16           
 Core - optional  Locale (locale)                                 Module  Not installed  6.16           
 Core - optional  Menu (menu)                                     Module  Enabled        6.16           
 Core - optional  OpenID (openid)                                 Module  Not installed  6.16           
 Core - optional  Path (path)                                     Module  Enabled        6.16           
 Core - optional  PHP filter (php)                                Module  Not installed  6.16           
 Core - optional  Ping (ping)                                     Module  Not installed  6.16           
 Core - optional  Poll (poll)                                     Module  Not installed  6.16           
 Core - optional  Profile (profile)                               Module  Not installed  6.16           
 Core - optional  Search (search)                                 Module  Not installed  6.16           
 Core - optional  Statistics (statistics)                         Module  Not installed  6.16           
 Core - optional  Syslog (syslog)                                 Module  Not installed  6.16           
 Core - optional  Taxonomy (taxonomy)                             Module  Enabled        6.16           
 Core - optional  Throttle (throttle)                             Module  Not installed  6.16           
 Core - optional  Tracker (tracker)                               Module  Not installed  6.16           
 Core - optional  Trigger (trigger)                               Module  Not installed  6.16           
 Core - optional  Update status (update)                          Module  Enabled        6.16           
 Core - optional  Upload (upload)                                 Module  Not installed  6.16           
 Core - required  Block (block)                                   Module  Enabled        6.16           
 Core - required  Filter (filter)                                 Module  Enabled        6.16           
 Core - required  Node (node)                                     Module  Enabled        6.16           
 Core - required  System (system)                                 Module  Enabled        6.16           
 Core - required  User (user)                                     Module  Enabled        6.16           
 Date/Time        Calendar (calendar)                             Module  Enabled        6.x-2.2        
 Date/Time        Calendar iCal (calendar_ical)                   Module  Not installed  6.x-2.2        
 Date/Time        Calendar Popup (jcalendar)                      Module  Disabled       6.x-2.2        
 Date/Time        Date (date)                                     Module  Enabled        6.x-2.4        
 Date/Time        Date API (date_api)                             Module  Enabled        6.x-2.4        
 Date/Time        Date Locale (date_locale)                       Module  Not installed  6.x-2.4        
 Date/Time        Date PHP4 (date_php4)                           Module  Not installed  6.x-2.4        
 Date/Time        Date Popup (date_popup)                         Module  Disabled       6.x-2.4        
 Date/Time        Date Repeat API (date_repeat)                   Module  Enabled        6.x-2.4        
 Date/Time        Date Timezone (date_timezone)                   Module  Enabled        6.x-2.4        
 Date/Time        Date Tools (date_tools)                         Module  Not installed  6.x-2.4        
 Date/Time        Node Repeat (node_repeat)                       Module  Enabled        6.x-1.1        
 Development      Devel (devel)                                   Module  Disabled       6.x-1.20       
 Development      Devel generate (devel_generate)                 Module  Not installed  6.x-1.20       
 Development      Devel node access (devel_node_access)           Module  Not installed  6.x-1.20       
 Development      Performance Logging (performance)               Module  Not installed  6.x-1.20       
 Development      SimpleTest (simpletest)                         Module  Not installed  6.x-2.9        
 Development      Theme developer (devel_themer)                  Module  Disabled       6.x-1.x-dev    
 Flags            Flag (flag)                                     Module  Enabled        6.x-1.3        
 Flags            Flag actions (flag_actions)                     Module  Not installed  6.x-1.3        
 ImageCache       ImageAPI (imageapi)                             Module  Enabled        6.x-1.8        
 ImageCache       ImageAPI GD2 (imageapi_gd)                      Module  Enabled        6.x-1.8        
 ImageCache       ImageAPI ImageMagick (imageapi_imagemagick)     Module  Not installed  6.x-1.8        
 ImageCache       ImageCache (imagecache)                         Module  Enabled        6.x-2.0-beta10 
 ImageCache       ImageCache UI (imagecache_ui)                   Module  Enabled        6.x-2.0-beta10 
 Meta tags        Nodewords (nodewords)                           Module  Enabled        6.x-1.11       
 Meta tags        Nodewords - basic meta tags (nodewords_basic)   Module  Enabled        6.x-1.11       
 Meta tags        Nodewords - extra meta tags (nodewords_extra)   Module  Enabled        6.x-1.11       
 Meta tags        Nodewords - site verification  meta tags        Module  Not installed  6.x-1.11       
                  (nodewords_verification_tags)                                                         
 Other            Backup and Migrate (backup_migrate)             Module  Enabled        6.x-2.2        
 Other            IMCE (imce)                                     Module  Not installed  6.x-1.3        
 Other            LoginToboggan (logintoboggan)                   Module  Not installed  6.x-1.6        
 Other            Page Title (page_title)                         Module  Enabled        6.x-2.3        
 Other            Pathauto (pathauto)                             Module  Enabled        6.x-1.3        
 Other            Token (token)                                   Module  Enabled        6.x-1.12       
 Other            Token actions (token_actions)                   Module  Not installed  6.x-1.12       
 Other            TokenSTARTER (tokenSTARTER)                     Module  Not installed  6.x-1.12       
 Pressflow        Cookie cache bypass (cookie_cache_bypass)       Module  Not installed                 
 Pressflow        Path alias cache (path_alias_cache)             Module  Not installed                 
 Statistics       Google Analytics (googleanalytics)              Module  Enabled        6.x-2.2        
 User interface   jQuery UI (jquery_ui)                           Module  Enabled        6.x-1.3        
 User Interface   jQuery Update (jquery_update)                   Module  Enabled        6.x-1.1        
 Views            Views (views)                                   Module  Enabled        6.x-2.10       
 Views            Views exporter (views_export)                   Module  Disabled       6.x-2.10       
 Views            Views UI (views_ui)                             Module  Enabled        6.x-2.10       
 Yahoo YUI        YUI (yui)                                       Module  Disabled       6.x-1.1-rc2    
 Yahoo YUI        YUI editor (yui_editor)                         Module  Disabled       6.x-2.33       
 Other            Bluemarine (bluemarine)                         Theme   Disabled       6.16           
 Other            Chameleon (chameleon)                           Theme   Disabled       6.16           
 Other            Garland (garland)                               Theme   Disabled       6.16           
 Other            Marvin (marvin)                                 Theme   Disabled       6.16           
 Other            Minnelli (minnelli)                             Theme   Disabled       6.16           
 Other            Pushbutton (pushbutton)                         Theme   Disabled       6.16 
LSU_JBob’s picture

Status: Needs work » Needs review

Changing back to needs review.

I fixed this by setting the granularity of the default date argument of the view from days to hours.

Danny_Joris’s picture

I have the exact same issue as Bob in #66. Views calendar: Upcoming: Filter date does not work. It's not listed.

--Edit: ok I found it under 'Date'. This works, but I'm unable to expose the filter.

LSU_JBob’s picture

Danny is the expose button just not appearing? or are you getting an error? Can you post a screenshot of your problem? Be sure that the granularity between the argument and the filter is the same.

Danny_Joris’s picture

So normally I would look for Content: Date - From date to filter my content, just like I use this for my fields and sorting. But under filters it is not listed. That's why I tried Date: Date (node) to filter instead.

What I want to do is list the events that are yet to come. But optionally, I want to list all of the events using a drop down. I don't understand why this drop down isn't showing. With other views lists, I can use a drop down with the option to just show all. So my date settings successfully show the events that are yet to come. (as you can see in the screenshot)

Screenshots: Edit screen of the view - Second edit screen of the view - the admin view of the calendar with the events list below

So yes, everything works great, but the filter is not exposed. I basically want only 2 options: show all dates or only show the upcoming dates.

Tnx for your help.

milehighlife’s picture

I'm have the same goal and issue in #70.

francesca79’s picture

It looks like date filter only works if raw style is set on fields.
When I set the view raw on "node" all dates get messed up.

I'm using last dev of date , views and calendar

Jackinloadup’s picture

sunscribe

nevosa’s picture

hi,
I had the same problem and moved to dev.
The problem did not resolve until I used the "Date default: " and entered: now.
The problem now became that when editing the content with dates I got a message that date_api.module expected a date and not a string.

The following resolved the isuue:

function date_format_date($date, $type = 'medium', $format = '', $langcode = NULL) {
if (empty($date)) {
return '';
}

if (get_Class($date) != 'DateTime') {
$date = new DateTime($date);
}

I hope this helps
kootenay Artesania

YK85’s picture

subscribing

jlockhart’s picture

subscribing

KarenS’s picture

Status: Needs review » Fixed

I think was caused by the same problem as #580178: Views: SQL Error "Unknown column" when using fields from different content-types in a filter. I reverted that change and I think things are working again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

goose2000’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
Status: Closed (fixed) » Active
Issue tags: +date filter

I am using these modules:

date-6.x-2.x-dev.tar.gz
views-6.x-3.x-dev.tar.gz

And I still can not get relative date filters like 'now' to work. I am just trying to show future events in a table. I can only get absolute filtering to work, like this:

Date: Date (node) Content: Date (field_date) - From date >= 2010-11-12 00:00:00

When I enter now into the relative field (default date) it will not take, it will not save.

"
Relative value

Relative values will be used if no date is set above. Use 'now' to default to the current date at runtime or add modifiers like 'now +1 day'. The To date default value is used when the operator is set to 'between' or 'not between'. You can use any values PHP's date_create() can understand, like between '12AM today' and '12AM tomorrow.

If the filter is exposed, these values will be used to set the inital value of the exposed filter. Leave both date and default values blank to start with no value in the exposed filter.
Date default:

"

vict116’s picture

I'm using this to also set up listing of future event dates (created using custom content type, using the datetime field) to be filtered. All I'm trying to do is enter 'now' into the "Date default" field. The SQL does not issue a current date in the WHERE clause, and it doesn't even look like the 'now' entry was ever saved. I've heard of people having troubles with this issue in Date 2.1 but I'm using Date 2.6 and even updated to the 2.X dev version from Nov. 7, 2010, but still not able to utilize the 'now' to be entered into the "Date default field".

Even tried switching (under Views) for this filter to switch "Date form type" from 'select' to 'text' and nothing worked. I tried to 'Expose' this also, and no fix.

Is it really supposed to be this difficult to use a 'now' clause? Or is this a bug that really needs to be addressed? I'm really confused at this point.

Using:
Content Construction Kit (CCK) 6.x-2.8
Views 6.x-3.x-dev (2010-Nov-12)
Date 6.x-2.x-dev (2010-Nov-07)

ayalon’s picture

See here:
http://drupal.org/node/957726

And here is a working solution:
http://drupal.org/node/965496

If I understand merlinofchaos correctly, then the bug is within the date module and the fix above will not be commited. Maybe the author of the date module should have a look at this because its quite easy to reproduce.

ayalon’s picture

Status: Active » Fixed

Its fixed within Views 3 dev:
http://drupal.org/node/965496

Bevan’s picture

Confirmed fixed in latest dev code.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mwbyrd’s picture

I stuggled with Views Filtering today and was finally able to get it to work. I don't know if this will help out or not.

Using
Date 6x-2.6
Date Popup 6x-2.6
Views 6x-2.11

I have a Date field in a custom content type that uses Date Popup. Make sure the Default time is set to 'Now'. I also set the 'To Date' to Blank. I chose the following Input Format: January 15, 2011 - 13:20 +0000. My granularity is Year, Month, Day.

In my View, I created an Upcoming Events block. First I set the Sort Criteria to Date: Asc. Then I saved the View. Then I added the Date: Date(node) Content: Date filter to Greater than or equal to 'Now'. I saved the View and it's working without any changes.

I went back and changed the Date Input Format to Sat, 01/15/2011 and it still works.

I'm not sure, but I wonder if doing the Sort first and then adding the filter allows it to work correctly.

Anyways, that worked for me.

Mike

hermes_costell’s picture

Version: 6.x-2.x-dev » 6.x-2.7

6.x-2.7 - date "greater than or equal to" "now" returned all results. "greater than" "yesterday" worked as expected. I would say this issue isn't yet fixed.

Bevan’s picture

Version: 6.x-2.7 » 6.x-2.x-dev

So leave it on 2.x then please.

mroswell’s picture

Component: Date CCK Field » Code

From what I can tell, the directions ask for lower-case "now" but upper-case "Now" is what actually works. Can anyone confirm my observation?

mroswell’s picture

Status: Closed (fixed) » Active
riverc’s picture

We have a similar issue. But instead, I'm getting this bizarro query. Any ideas, anyone?

SELECT node.nid AS nid,
   node_data_field_date.field_date_value AS node_data_field_date_field_date_value,
   node_data_field_date.field_date_value2 AS node_data_field_date_field_date_value2,
   node.type AS node_type,
   node.vid AS node_vid,
   node.title AS node_title,
   location.lid AS location_lid,
   node_revisions.teaser AS node_revisions_teaser,
   node_revisions.format AS node_revisions_format
 FROM node node 
 LEFT JOIN content_type_public_event node_data_field_date ON node.vid = node_data_field_date.vid
 LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid
 LEFT JOIN location location ON location_instance.lid = location.lid
 LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
 WHERE ((node.status <> 0) AND (node.type in ('public_event')))
    AND ((DATE_FORMAT(ADDTIME(STR_TO_DATE(node_data_field_date.field_date_value, '%Y-%m-%dT%T'), SEC_TO_TIME(-18000)), '%Y-%m') <= '2011-12' AND DATE_FORMAT(ADDTIME(STR_TO_DATE(node_data_field_date.field_date_value2, '%Y-%m-%dT%T'), SEC_TO_TIME(-18000)), '%Y-%m') >= '2011-12'))
   ORDER BY node_data_field_date_field_date_value DESC

the problem seems to be that it should be bounding the query by node_data_field_date.field_date_value both ways, but for whatever reason, it bounds it by the valid field (field_date_value) from below, but from above it is bounding it by field_date_value2 - a field which I'm unsure of. I think in fact it is the end date field, but I'm confused as to why, if I've only chosen the argument to be 'from date', i'd be getting 'to date' in the query?

Reading the thread, it really seems like Date is bungled up. This is a production site which went live before we realized Calendar was buggered out -- is there any clean fix to this?

Prior to messing around with this, Views was managing to find and display non-existent events on the calendar - ones we had deleted - ! Caching was not on.

Date is 6.x 2.4. Shall I brave the dev version?

mathankumarc’s picture

upgarded to 6.x 2.7 and its solved the problem

riverc’s picture

Updating to 2.7 didn't work for us, unless we're going to have to entirely rebuild the Calendar - which I don't think is possible on the production site without taking it down for a day - which we can't do. Any solutions?

Bevan’s picture

Status: Active » Closed (fixed)

Please don't re-open closed issues. Find an open issue or create a new issue instead.

riverc; Your issue is probably not the same if upgrading didn't fix it.

xtfer’s picture

For anyone struggling with this in Views 2, use the Content: Date version of the field instead of the Date: Date version, and it should work fine.

vglocus’s picture

I had the same problem and I found that an inherited date argument from Calendar view (default in Calendar) was overtaking my filter. As my "List view" calendar doesn't need this agrument I removed it and suddenly I had no more problems.

Budrick’s picture

Version: 6.x-2.x-dev » 7.x-2.6
Component: Code » Miscellaneous
Category: bug » support
Priority: Normal » Minor

If 'now' is not working for Drupal 7 and Views 3 - make sure that 'Date Views' module is enabled.

whop’s picture

Priority: Minor » Major
Status: Closed (fixed) » Active

Hello there,

its old topic but I have similar problem.

I am using 2 views to display passed and future events.
Its working nice for admin user.

But normal user cant see future events, only passed.
really strange for me.

i tried to copy "passed view display" which is working correctly, and only changed filter to /start date is >= "now"/ (changed from <).

Please, do you have any clue ?
Unfortunately for me, its very urgent.
Thanks a lot!!!

vijaycs85’s picture

Issue summary: View changes
Priority: Major » Normal
Status: Active » Fixed

@whop, this is not same problem what this issue trying to solve. Please open a new issue with details and set priority as per https://drupal.org/node/45111

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.