In drupal 5 and Views 1 we had an possibility to add separately filters for each component of the date field.

For example,

For the displaying list of users birthday today (in drupal 5 and views 1) I added the next filters:

month == now
day == now

and the year is unimportant.

in drupal 6 and views 2 I cant add separately filters, I just can add date field completely including the year.

Certanly it doesnt allow me to create the birthdays today list.

After all, those who was born in 2009 hardly will manage to be registered on a site.)))


vasike’s picture


KarenS’s picture

Category: bug » feature
Priority: Critical » Normal

This is not a critical bug report, it is a feature request.

OFF’s picture

This bug because this feature was in past version (I mean 5.x) and users will conflict with a problem at an upgrade.

drupalok’s picture


arlinsandbulte’s picture

capellic’s picture

Status: Closed (duplicate) » Active

I don't see this as a duplicate of #313498: Add granularity to Date Field filter & sort criteria in Views for anniversary type events, rather it's about being able to filter on the discrete date segments. For example, I have a document library and each document has a date. I have an exposed filter with the granularity of "month." If a user selects only the year, they get all the documents from January of that year. Apparently blank gets forced to 1.

Also, if a user doesn't select the year and only selects the month, the view filter isn't applied at all. I'd expect that documents from that month, regardless of year, would appear.

This issue is related to #374861: Exposed date filters not filtering properly when granularity is set to "month".

rvilar’s picture


1kenthomas’s picture

Unless someone replies | this is applicable to D7, I will close within 90 days given the age of the issue. "Bump."

rvilar’s picture

Excuse me, but I don't understand your comment. What do you want to say?

This issue isn't resolved yet.

tfo’s picture


geoffv’s picture

The date filter should be split by each component, as requested. This is exatly what I require.
If this was possible in D5, then I would consider it a regression, and as such a bug. There is a similar thread in the Views issue, that seems to have been forgotten about.

Tesmon’s picture


colan’s picture

Version: 6.x-2.2 » 7.x-2.x-dev
Issue summary: View changes

Let's get this done in D7 (as I'm hoping to get this done for a project soon), and then we can forward port it to D8 (either to core or this module, depending on where this type of filter is supposed to go).

What's needed a granularity selector added to the "greater than" and "less than" filters so that certain time elements can be ignored in the comparison. So we'll have these checkboxes, where any of them can be checked. Leaving them all blank will work the default way, with all elements being involved in the comparison.

  • Year
  • Month
  • Day
  • Hour
  • Minute
  • Second

This will fix the other two issues:

For my reference (or whomever works on this), there's some old code around which may be helpful. I don't think it'll be that useful as all we need to do is zero the elements we'll be ignoring in the comparison. But here it is just in case:

martin.l’s picture


colan’s picture

@martin.l: It is no longer necessary to add "subscribing"-type comments. Simply click on the "Follow" button at the top-right of the issue.