Hi!

I created a datetime field with CCK, a textfield with a pop-up calender.
The problem is, with views, i cant Filter on this field. When i click on Add filter, the field is not showing. However, when i click on Add sort criteria, the datetime field IS showing.

What am i doing wrong? =)

Comments

darthf1’s picture

Title: Datetime field not showing in Filter » CCK Datetime field not showing in Filter
superbaloo’s picture

Maybe you have to write a plugin for views, use the views API to create a new filter :)

Inherit it from views_handler_filter

Check http://views-help.doc.logrus.com/ for this :)

superbaloo’s picture

Component: User interface » Code

BTW, it's more a code related issue than user interface

dawehner’s picture

As alternative you could do something with hook_views_pre_query. But thats not as easy as it seems :)

darthf1’s picture

ok thnx, ill look into the code thing.

Isnt there a simple explanation why this field is showing up in sort criteria, but not in the filter?

merlinofchaos’s picture

Project: Views (for Drupal 7) » Date
Version: 6.x-2.6 » 6.x-2.x-dev

Please read the submission guidelines before posting.

skybow’s picture

I just had the same problem as you described. I could not figure out how to add the damn date field to the filter.
I looked on how I did it in another project, and it works there. I looked, and looked, and looked... (it's getting late here)

And finally I realized that I wasn't seeing the wood for the trees:
You have to add a "Date (node)" filter. After adding, you'll be able to select your date field. Date fields don't show up in the "Content" section. It's a bit confusing, I guess.

HTH

darthf1’s picture

Wow! Thats exactly the feedback i needed.

Many thanks!

darthf1’s picture

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

Thank you skybow, had the same issue

aauger@diocese-sacramento.org’s picture

Thank you, it worked great.

achaux’s picture

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

Thank you skybow, I was stuck on this for quite a while.

Rizhaya’s picture

Oh! Thank you, skybow! It was a kind of nightmare to me =))

ChiliConSql’s picture

Awesome! Thank you skybow.