Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#66 | LSU_JBob_calendar_view_export.txt | 24.73 KB | LSU_JBob |
#54 | date_views_export.txt | 14.63 KB | Macronomicus |
#35 | export_view_relative_time.txt | 9.73 KB | robbiethegeek |
#29 | dupe-date-filters.png | 18.76 KB | markabur |
#21 | 426990_date_filters.patch | 7.61 KB | gdd |
Comments
Comment #1
Torenware CreditAttribution: Torenware commentedWhat exactly are you trying to get here?
There are a couple of possibilities here, depending upon what you want and what you're currently doing.
Comment #2
maykbrito CreditAttribution: maykbrito commentedsame 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.
Comment #3
mattyoung CreditAttribution: mattyoung commentedI 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?
Comment #4
Torenware CreditAttribution: Torenware commentedOK, 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.
Comment #5
mattyoung CreditAttribution: mattyoung commentedI 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:
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.
Comment #6
higherform CreditAttribution: higherform commentedSaw 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.
Comment #7
jpetso CreditAttribution: jpetso commentedYep, 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.
Comment #8
jpetso CreditAttribution: jpetso commented@Torenware: The patch you mentioned does not resolve the issue.
Comment #9
jpetso CreditAttribution: jpetso commentedChecked the dev version (DRUPAL-6--2 branch from today, April 9) and this particular issue is fixed there.
Comment #10
jpetso CreditAttribution: jpetso commentedOops, I actually wanted to mark this issue as "fixed".
Comment #11
Gábor HojtsyExperienced the same. Upgrading to -dev solved the problem.
Comment #12
starbow CreditAttribution: starbow commentedNote for anyone frustrated on this issue - remember to clear your cache after you upgrade.
Comment #13
HelloStephanie CreditAttribution: HelloStephanie commentedI 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
Comment #14
Kisama CreditAttribution: Kisama commentedSubscribing, 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.
Comment #15
mattyoung CreditAttribution: mattyoung commented#13, #14:
As others have indicated here, using the dev version solved this problem. Are you using the dev version?
Comment #16
HelloStephanie CreditAttribution: HelloStephanie commentedI completely deleted all previous -dev and have intalled:
Date 6.x-2.1
Views 6.x-2.5
CCK 6.x-2.2
Comment #17
HelloStephanie CreditAttribution: HelloStephanie commentedWhoops! 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.
Comment #18
zmo CreditAttribution: zmo commentedFor 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.
Comment #19
steppek CreditAttribution: steppek commentedI 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
Comment #20
steppek CreditAttribution: steppek commentedMy Bad. I updated the Views module to dev....not Date as mentioned above. It is working now with Date dev. Thank you.
Comment #21
gddI made a patch for this issue, which doesn't require updating the whole dev version. Attached if anyone wants it.
Comment #22
robbiethegeek CreditAttribution: robbiethegeek commentedJust wondering if there is an idea of this getting rolled into a release?
RobbieTheGeek
Comment #23
pam.pkrweb@gmail.com CreditAttribution: pam.pkrweb@gmail.com commentedHi! 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
Comment #24
gddIf you do not wish to install the patch, you can simply use the newest -dev release of Date.
Comment #25
jastylr CreditAttribution: jastylr commentedHow 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.
Comment #26
jastylr CreditAttribution: jastylr commentedAlso, 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.
Comment #27
J V CreditAttribution: J V commentedIn release notes for 2.1 it says its fixed, but it isn't... Why? Can we expect 2.2 with a decent fix soon?
Comment #28
fletch11 CreditAttribution: fletch11 commentedlatest dev version appears to work for me
Comment #29
markabur CreditAttribution: markabur commentedi 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:
WITHOUT date filter:
Comment #30
markabur CreditAttribution: markabur commentedfwiw 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.
Comment #31
KarenS CreditAttribution: KarenS commentedThe 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.
Comment #32
DjebbZ CreditAttribution: DjebbZ commentedAs 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 !
Comment #33
cpill CreditAttribution: cpill commentedJust 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?
Comment #34
cpill CreditAttribution: cpill commentedopps, sorry, was looking at the wrong version number :P
Comment #35
robbiethegeek CreditAttribution: robbiethegeek commentedHere is an exported view that is currently experiencing this issue. It is the block view using the relative time of Now
Comment #36
aaustin CreditAttribution: aaustin commentedThe 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.
Comment #37
ultimateboy CreditAttribution: ultimateboy commentedTested on -dev release. Problem still exists.
Comment #38
KarenS CreditAttribution: KarenS commentedI 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.
Comment #39
aaustin CreditAttribution: aaustin commentedSorry it was a miscommunication, my partner grabbed and installed the latest version of views.
Comment #40
cpill CreditAttribution: cpill commentedHave 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.
Comment #41
chadd CreditAttribution: chadd commentedjust 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.
shouldn't that be
?
Comment #42
chadd CreditAttribution: chadd commentedi 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 :)
Comment #43
greg.harveyRe-opening, due to comment in #41. Proper patch required, I guess. Will test myself soon.
Comment #44
mikeybusiness CreditAttribution: mikeybusiness commentedI saw that on http://drupal.org/node/465872 chadd had posted something similar. KarenS had answered it thusly:
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
Comment #45
chadd CreditAttribution: chadd commentedyes, 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.
Comment #46
Aldus CreditAttribution: Aldus commentedI 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?
Comment #47
Adeon CreditAttribution: Adeon commentedHaving 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!
Comment #48
hackwater CreditAttribution: hackwater commentedSubscribe
Comment #49
hackwater CreditAttribution: hackwater commentedHere'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.
Comment #50
greg.harveyI 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?
Comment #51
alpapan CreditAttribution: alpapan commentedRight... 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
Comment #52
Macronomicus CreditAttribution: Macronomicus commented@chadd
That didnt seem to fix it for me :(
Comment #53
greg.harvey*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! =)
Comment #54
Macronomicus CreditAttribution: Macronomicus commented@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.
Comment #55
greg.harvey@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.
Comment #56
Macronomicus CreditAttribution: Macronomicus commented@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
Comment #57
andrew_hoffi CreditAttribution: andrew_hoffi commentedI 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.
Comment #58
arlinsandbulte CreditAttribution: arlinsandbulte commented@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
Comment #59
andrew_hoffi CreditAttribution: andrew_hoffi commentedThank you very much, I was not aware of this change. Problem solved!
Comment #60
arlinsandbulte CreditAttribution: arlinsandbulte commentedI'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.
Comment #62
stevenaburton CreditAttribution: stevenaburton commentedThis 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".
Comment #63
scip CreditAttribution: scip commentedSee this... http://drupal.org/node/753988
Comment #64
yurtboy CreditAttribution: yurtboy commentedwow 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.
Comment #65
kranicservin CreditAttribution: kranicservin commentedComment #66
LSU_JBob CreditAttribution: LSU_JBob commentedThis 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.
Comment #67
LSU_JBob CreditAttribution: LSU_JBob commentedChanging back to needs review.
I fixed this by setting the granularity of the default date argument of the view from days to hours.
Comment #68
Danny_Joris CreditAttribution: Danny_Joris commentedI 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.
Comment #69
LSU_JBob CreditAttribution: LSU_JBob commentedDanny 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.
Comment #70
Danny_Joris CreditAttribution: Danny_Joris commentedSo 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.
Comment #71
milehighlife CreditAttribution: milehighlife commentedI'm have the same goal and issue in #70.
Comment #72
francesca79 CreditAttribution: francesca79 commentedIt 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
Comment #73
Jackinloadup CreditAttribution: Jackinloadup commentedsunscribe
Comment #74
nevosa CreditAttribution: nevosa commentedhi,
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
Comment #75
YK85 CreditAttribution: YK85 commentedsubscribing
Comment #76
jlockhartsubscribing
Comment #77
KarenS CreditAttribution: KarenS commentedI 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.
Comment #79
goose2000 CreditAttribution: goose2000 commentedI 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:
"
Comment #80
vict116 CreditAttribution: vict116 commentedI'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)
Comment #81
ayalon CreditAttribution: ayalon commentedSee 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.
Comment #82
ayalon CreditAttribution: ayalon commentedIts fixed within Views 3 dev:
http://drupal.org/node/965496
Comment #83
Bevan CreditAttribution: Bevan commentedConfirmed fixed in latest dev code.
Comment #85
mwbyrd CreditAttribution: mwbyrd commentedI 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
Comment #86
hermes_costell CreditAttribution: hermes_costell commented6.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.
Comment #87
Bevan CreditAttribution: Bevan commentedSo leave it on 2.x then please.
Comment #88
mroswell CreditAttribution: mroswell commentedFrom what I can tell, the directions ask for lower-case "now" but upper-case "Now" is what actually works. Can anyone confirm my observation?
Comment #89
mroswell CreditAttribution: mroswell commentedComment #90
riverc CreditAttribution: riverc commentedWe have a similar issue. But instead, I'm getting this bizarro query. Any ideas, anyone?
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?
Comment #91
mathankumarc CreditAttribution: mathankumarc commentedupgarded to 6.x 2.7 and its solved the problem
Comment #92
riverc CreditAttribution: riverc commentedUpdating 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?
Comment #93
Bevan CreditAttribution: Bevan commentedPlease 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.
Comment #94
xtfer CreditAttribution: xtfer commentedFor 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.
Comment #95
vglocus CreditAttribution: vglocus commentedI 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.
Comment #96
Budrick CreditAttribution: Budrick commentedIf 'now' is not working for Drupal 7 and Views 3 - make sure that 'Date Views' module is enabled.
Comment #97
whop CreditAttribution: whop commentedHello 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!!!
Comment #98
vijaycs85@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