There are a few situations that some people need to filter nodes by a date-field on their repeat in a month or week. For example I have a content type of Event and it has a date-field (with optional end-date) and want to create a "view" to show todays event's.
I've searched a lot and tried lots of modules (such as partial_date, calendar, timefield, ...) but i couldnt come up with a good clean solution to my problem; dealing with yearly, monthly and weekly events using a Date field.
So I thought that it might be good approach to change type of "Filter granularity" (on filter extra settings for Date field types in Views) to checkboxes.
I've created a patch on date\date_api\date_api_sql.inc and would be thankful if you guys review and improve it since I'm new to drupal.
So its possible to query only on month and day component of a date-field (yearly events such as birthdays):
Comment | File | Size | Author |
---|---|---|---|
views-filter-granularity-checkboxes-for-repeating-dates.patch | 7.4 KB | aramalipoor | |
yearly_date_filter_sample.png | 66.25 KB | aramalipoor | |
date_radios_checkboxes.png | 64.97 KB | aramalipoor |
Comments
Comment #1
vijaycs85Comment #2
wwedding CreditAttribution: wwedding commentedI haven't had an opportunity to see how well it works yet but there are some style issues. Otherwise I like what I'm seeing!
You can refer to: https://drupal.org/coding-standards
I also like to run my code through the Coder module since I forget guidelines all the time.