Drupal 7 List nodes within the date range

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
asifroyal's picture

I am looking for a solution which displays node list within the date range. Requirement is to display events from today to next 6 days group by date. I have a content type "Agenda" with a date field enabled. So the display should look like:

2 Jan 2012
-- 8:00 AM Agenda A
-- 9:00 AM Agenda B
3 Jan 2012
-- 8:00 AM Agenda C
-- 9:00 AM Agenda D
4 Jan 2012
-- 8:00 AM Agenda..
-- 9:00 AM Agenda..
5 Jan 2012
-- 8:00 AM Agenda..
-- 9:00 AM Agenda..
6 Jan 2012
-- No events scheduled
7 Jan 2012
-- No events scheduled

I tried with the Views module and the Calendar module also, but I don't want to display in calendar style format, and I need to display only these 6 days (now +6 day), not the entire month view. Other styles are not fulfilling my requirement.

Here I have display 6 dates and display node/event associated with its otherwise display "No events".

Could you please suggest something?

Comments

subs

mcferren's picture

subs

You can use "Views node

phthao's picture

You can use "Views node field" to have a field that shows as a node (with a choice of build mode). I think that should work.

Here's how I would do it

dale42's picture

Here's how I would do it. In order for this to work the "Date Views" module needs to be enabled.

- Go to Home » Administration » Configuration » Regional and language » Date and time - Formats Tab
- Add format: g:m A (produces format: 9:02 PM)
- Add format: j M Y (produces format: 25 Feb 2012)
- Go to Home » Administration » Configuration » Regional and language » Date and time - Types Tab
- Click Add date type and add Date type: "Date only" using format 25 Feb 2012
- Click Add date type and add Date type: "Time only" using format 9:02 PM

Go to your View:
- Add your date field:
--- for "Choose how users view dates and times" select "Date only"
--- Exclude from display
--- Under More set Administrative title as Date only
- Add the same date field a second time:
--- for "Choose how users view dates and times" select "Time only"
--- Under More set Administrative title as Time only
--- Select Rewrite results and with correct token make the rewrite value: -- [field_date_proper_token]
- Under Format settings Group by Date Only
- Under Field settings set Title (or whatever) and Time only to be inline
- Add your date field under Filter Criteria:
--- Operator: greater than or equal to
--- Select: Enter a relative date
--- Relative date: now
- Add your date field a second time under Filter Criteria:
--- Operator: less than or equal to
--- Select: Enter a relative date
--- Relative date: now + 6 days

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: