This project is read-only.

query filters date only month

Topics: Administration, Customizing Orchard, General
Oct 31, 2012 at 8:07 PM


i need your help... again :s

i m creating a filter to a query whit a datetime field. the problem is that all I can filter on full date, but I just need to filter by month, 

Does anyone have some idea???? 

Oct 31, 2012 at 8:21 PM

You should be able to just specify the month in your filter. How does your current filter look like?

Oct 31, 2012 at 8:58 PM

is the default filter of projection filters


this is a caption-    

Oct 31, 2012 at 10:03 PM

So you want to query for all content where that datetime field has a specific month, regardless of the year or day. In that case you may have to write your own filter. You could copy the datetime filter and make adjustments.

Oct 31, 2012 at 10:28 PM

Doh! You say I should change the module? 

Oct 31, 2012 at 10:30 PM

I would create a custom module and copy over the filter implementation, make changes to the copy.

Oct 31, 2012 at 10:41 PM

mmm, there is not a simplest way to do?? :S

Oct 31, 2012 at 11:06 PM

Sorry, I don't think you can do it with the current datetime filter.

Oct 31, 2012 at 11:11 PM

Answer this question first: You want to filter on a month of a known year, or for a month whatever the year is. "For instance any event in January of every year" or just "the current month"


Nov 1, 2012 at 5:03 PM

dear sebastienros:  i want for a month whatever the year is,  I want to create a monthly calendar with birthdays of all employees of a company, regardless the ages

Nov 1, 2012 at 5:12 PM

You will need to create a custom filter for that then. And as the date time doesn't extract this information for the date you will need to do a weird query with lots of ORs.

Or maybe someone knows a better way. There is a way in sql and hql but I am not sure it can be done with the exposed interface.

Nov 1, 2012 at 5:25 PM