Friday, February 27, 2009

Upcoming event calendar using date, views and cck

Upcoming event calendar using date, views and cck
Post installation · Drupal 6.xfhsm - October 25, 2008 - 17:16
I’m trying to use a combination of date, calendar, views, and cck to make a calendar of upcoming events and I’m not having much luck. The basic problem is that my calendar view is sorting based on the changed field in the node table, not on the date and time set for my events.

I'm going to make this detailed so thanks so much in advance for your help!

To get to this point I:

I used CCK to make a new content type event to which I added one additional field event_datetime of type datetime using the text field custom input format as Mo/Da/Year – TimeAM/PM (ex: 10/25/2008 – 11:45am).

Then in views I cloned the default calendar view. I used filter to set Node: Type = Events to remove non-events from my calendar and Content: Event Date and Time (field_event_datetime value) asc to hopefully sort get events to show up on the correct days. I will include a full copy of my calendar view's 'default' settings pain at the end of the post.

This isn't working. Instead I’m getting a great calendar view that shows all of my events nodes on the date the event is created / updated (today) not the date set for the event to occur in the event creation process (some time in the future).

The MySQL table content_type_event shows the values I set when creating my events as field_event_datetime_value and field_event_datetime_value2. Manually editing the created feild and changed feild in the nodes table moves them on the calendar view. In sum it appears my calendar is sorting based on node creation and not event datetime.

Bottom Line: Can someone please tell me how in the world I make views sort based on the correct field?

Views keeps coughing up a huge SQL query that looks like it would be helpful to someone with more knowledge, so here that is:

SELECT node.nid AS nid,
node.changed AS node_changed,
node.title AS node_title,
node_data_field_event_datetime.field_event_datetime_value AS node_data_field_event_datetime_field_event_datetime_value,
node.type AS node_type
FROM node node
LEFT JOIN content_type_event node_data_field_event_datetime ON node.vid = node_data_field_event_datetime.vid
WHERE ((node.status <> 0) AND (node.type in ('event')))
AND ((ADDTIME(FROM_UNIXTIME(node.changed), SEC_TO_TIME(-14400)) <= '2008-10-31 23:59:59' AND ADDTIME(FROM_UNIXTIME(node.changed), SEC_TO_TIME(-14400)) >= '2008-10-01 00:00:00'))
ORDER BY node_data_field_event_datetime_field_event_datetime_value ASC

I tried just blindly dropping that into phpMyAdmin and got back reasonable results:

nid node_changed node_title node_data_field_event_datetime_field_event_datetime_value node_type
7 1224949001 Test Event 1 2008-11-04 11:36:41 event
8 1224949115 Event Test 2 2008-11-25 11:38:35 event

This just makes me think that I'm not smart enough to figure views out because it is clearly getting the right info out of MySQL it's just sorting on the wrong column.

Settings from my testcalendar view's default settings tab:

View settings
Tag: Calendar

Basic settings
Name: Defaults
Title: None
Style: Calendar navigation
Use AJAX: No
Use pager: No
Items to display: Unlimited
More link: No
Distinct: No
Access: Unrestricted
Link display: Calendar page
Exposed form in block: No
Header: None
Footer: None
Empty text: None
Theme: Information

None defined

Date: Date (node.changed)

Node: Title Title

Sort criteria:
Content: Event Date and Time (field_event_datetime value) asc

Node: Published True
Node: Type = Events

» Login or register to post comments
Arguments are the solution!
fhsm - October 25, 2008 - 19:43
I was able to solve my problem after a bit of time digging around in the source and blindly slamming on the UI. The problem was the Arguments section of the views setup.

Date: Date (node.changed)

Should be switched to
Content: Event Date and Time (field_event_datetime value) (or whatever else you want to sort using.

This was super frustrating. I did a lot of googleing and didn't really turn up anything that got me where I needed to go. and were somewhat helpful but left out a key detail.

I'd like to write up a bit of documentation for the next newbie with the same problem. Where should I put such a writeup? Here in the forum or elsewhere on
Login or register to post commentsHow to make a calendar of upcoming events
fhsm - October 25, 2008 - 21:15
I recently setup an upcoming event calendar on Drupal 6.x. I had a hard time finding instructions so here's my experience...

I did not use the event module because a version for 6.x isn’t out yet; however, there are other reasons not to do so discussed in the forums.

Instead I used:

Download and install the above modules to /sites/all/modules and enable them at Administer › Site building > Modules

Step 1: make a custom ‘event’ content type using CCK
Go to Administer › Content management › Content types > add content type

Name = “Group Event”
Type = “event”
Description = “Create a new event to appear on the sites calendar of upcoming events”

The following settings are largely a matter of site needs and personal preference:
Under “Submission form settings”
Title = “Event”
Body = “Details”

Under “Work flow settings”
Decide to best fit your site. It is worth considering unchecking “Promoted to front page” if you expect to have numerous small events posted.

Under “Comment settings”
Make decisions which are appropriate for your site.

Save your new event content type.

From the content type screen (Administer › Content management) select manage fields next to your new content type.

Add a new field

Label = “Event Date and Time”
Field name = “event_datetime”
Type = “Datetime”
Widget type = “text field with custom input format”

There is some debate over the correct type to select here.
The widget type dictates the input UI and is really a matter of preference. It’s easy to change after the fact so try them all and see what you like best.

Save your newly created event date/time field.

The field options on the following page are reasonably self explanatory and a matter of taste.
Pay attention to the “To Date” option as it will allow you to set the end of your event (more important if you want an iCal feed ultimately).
For most people

Granularity = year, month, day, hour, minute (not second) selected
To Date = optional will be correct

You can of course add any number of additional fields to your event content type at this point using CCK. I've added location and contact information for my application and tied those to weather and profiles which is kind of cool (but way beyond this little write up) and testament to how amazing Drupal really is.

Step 2: Create your first event
Create content > Group Event
Fill out the form for your event and save it.

Step 3: Configure your calendar view
Administer > Site building > Views
This is where the hurt started for me 6 hours ago...

Enable the Default Node view: calendar (Calendar)
Clone the default view

View name = “calendar”
View description = “Calendar of group events”

Nextshould take you to the views edit screen

Down the right side you'll see all the different types of calendar (page, block etc) just work with the default view to start (it should be where you are by default).

In the Arguments panel
Click Date: Date (node.changed)
Near the bottom of the page under Date field(s):

uncheck = Node: Update date
check Content: Event Date and Time (field_event_datetime value)

Click Update

This set the start time of your event instead of the node update time as the argument for the view.

On the Filters panel click the “+” logo to add a new filter
Check = Node: Type
Click add
On the following screen
Leave operator = “Is one of” and check = Events to limit your calendar to only the event content type.

Click Update

On the Sort criteria click the “+” to add a new criteria

Check = Content: Event Date and Time (field_event_datetime value)

click Add

Save it all by clicking Save

Step 4: make sure it works
Use the View "Calendar page link to confirm your new calendar is up and working.

That will at least get you to a working calendar of coming events for your site. Obviously you’ve got a ton of configuration options to play with form here.

This is a very powerful package. While it's not hard to setup it's got a lot of steps and many opportunities to go wrong. The key here is to set the argument / sort / filter bit of views configuration. This combination of modules seems to want to create a calendar widget for digging into the archives by default but it is easy enough to have it do otherwise.

Hope this is helpful for someone down the road.

Login or register to post comments
wow--- excellent writeup.
WorldFallz - October 25, 2008 - 21:18
wow--- excellent writeup. you should definitely make this a handbook page for the calendar/date modules.

"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Login or register to post commentsMulti-Day Events & Timezones
Daniel Berman - October 27, 2008 - 17:06
Thanks for the writeup fhsm! Two questions.

- Any ideas as to how the procedure changes for handling multi-day events, especially in terms of displaying properly within the calendar view?

- For an international audience, whats the best way to handle a timezone field?

The reason I am asking is because, I am trying to set up an international events calendar, on my site, I need people to be able to enter the local time of their event, but have the time properly converted for others who may be joining the event electronically from different timezones.

My inituition, would be that I would need the event's location, the user's location, and the internal server time to anchor the calculations. So then, if the event location could be picked up by the location module. I would just need the other two data points, and then run it through views properly. Am I heading in the right direction, or right off a cliff?

Login or register to post comments
partial answer here
Daniel Berman - October 27, 2008 - 17:24

Login or register to post comments
This was very helpful for
knaa - October 28, 2008 - 15:32
This was very helpful for me, particularly the part about setting the start time of an event in the calendar, instead of the update time. I wonder why the module maintainer have it set to the update time by default. I guess everyone has different uses for a calendar. Like you, I use it primarily for upcoming events.

Thank you for the excellent write-up. I agree this write-up should become part of the Calendar handbook.

Login or register to post commentshappy coincidence
justageek - October 28, 2008 - 21:20
Here are a couple of ways to use the repeating-date api with the event calendar as described in your post, note, you will have to choose the one that fits based on caveats listed.

When created your event_date_time field, choose the option to automatically include a 'To' field. Drupal will add a second field, so you can enter a From and To date. Also, when adding your field using CCK, for the Widget Type, make sure you choose one that includes "repeat options. This allows you to indicate how your event repeats, there are many, many great ways to repeat dates

Caveats with this method - If you create a date that starts on 10/28/2008 at 3:00PM and the To date is 10/31/2008 at 4:00PM, the calendar view will basically show the date 10/30/2008 instance of your event as All Day. In other words, Drupal assumes that your date starts at 3:00 PM on 10/28 and ends on 10/31 at 4:00PM. So, if you are wanting to show, say, a training class that goes from 1:00 PM to 3:00 PM each day, this will not work properly.

So, to create an event like this training class, you should create a single event that starts on 10/28/2008 at 1:00 PM and ends on 10/28/2008 at 3:00PM, then use the "repeat" feature to repeat the event until Nov 1. You need it to repeat until Nov 1, because apparently the end date for your repeat is not included, so it causes your class to show on 10/28,10/29, 10/30, and 10/31. NOTE: the start and end times only show on day 1, which would be the 28th.

So, you need to figure the following before you do your work:

Do I need to use the repeat function to repeat single days within an event, where the days have their own start and end time, or do I need to repeat events throughout the years, such as monthly meetings or something like that.

The cool thing is, there are a bunch of ways to do all this stuff, you could create separate start and end time fields and make your event date field the date portion only, this would give you more flexibility.

I hope this helps someone, my experiments have really enlightened me.

I think that it is much more flexible to store your event start and end times in separate fields. You can create multi-day events that also repeat throughout the year this way.

Login or register to post comments
and another approach without using repeat, when node is same
zilla - October 31, 2008 - 04:46
if node is same and only date changes and does not specifically 'repeat at same time' AND you don't want that big nerdy 'repeat interface' that scares users, you can use cck unlimited on just date element in event custom type, details and write up here: (somebody oughta pull this all into a handbook page!)
(question related to a movie theatre with movies (where title/body stays the same) and many 'show times' that may or may not repeat...but need to come up in a view (calendar, block, page, etc) - also quite detailed for a new user...
i love to waste time:

Login or register to post comments
Thanks for this great
elektro - November 20, 2008 - 19:40
Thanks for this great howto!

I have the same problem when I use date with repeats. My block shows the same events.
I can't use the CCK unlimited setting because I use the jQuery input format and not the "text field with custom input format".

I would need a solution that makes the view distinct by the node id.


Login or register to post comments
Fantastic - thank you!
Sloane DellOrto - October 31, 2008 - 03:58
fhsm - Can't thank you enough for taking the time to write these instructions ... have been too afraid to try this module until now, and thanks to you I have a calendar up and working perfectly! This knocks the socks off of Events in many ways - thank you thank you thank you! And of course a HUGE nod at Earl and everyone else involved with Views. This is just damn cool stuff, even if I don't understand half of it. ;-)

Login or register to post commentsVery helpful...but now I'm stuck
bixwilson - October 31, 2008 - 18:14
fhsm, thank you for putting this guide together. I had installed all those modules and was trying to get my View running, but I wasn't using the default calendar view. You helped me get back on track.

BUT, now that I've followed your instructions and set up the calendar view, the preview is broken....I'm getting a message that says "An error occurred at /acdrupal/admin/build/views/ajax/preview/classes_calendar."

The preview is not working, and the path to the view, /calendar, brings up a blank page.

Do you or anyone else know anything about this ajax error?


Login or register to post comments
might be version issues
justageek - November 3, 2008 - 16:36
I had the blank page suddenly happen, and by turning on php errors, I found that the calendar is calling a missing function in the Date module, the latest dev version of the Date module has it in there. Since these are still actively developed, I think this might happen from time to time. Try upgrading the Date module and see if the blank page issue is fixed.

Login or register to post comments
Just what I needed
danimagoo - November 1, 2008 - 23:18
Thank you so much for this, I was trying to use the Events module and it wouldn't do everything I needed. Views has always intimidated me a bit. Your step-by-step instructions worked perfectly. Thanks!

Login or register to post commentsAdvanced Help
kwgossett - November 3, 2008 - 15:32
fhsm - this is awesome. In addition to the Handbook, see if they will include the code in the Advanced Help module as an example - typically found at

I'm not sure if you would ask the maintainer of Advanced Help or views (merlinofchaos) or the maintainer of Calendar (KarenS)...still, I'm sure it has a place among their current examples.


Login or register to post commentsChange date color...
Dr. Rhomboid Go... - November 3, 2008 - 23:28
Love the calendar, and now I want to get fancy. Any thoughts on how to change the background color of a date on the calendar based on the content of a field in the event node?

I'm building a calendar for a sport league and added a field to the event (called event_type) that is a radio button with the options of Home, Away, or Other.

I'd like to make the background of the date change color based on the event_type field (ie. days of home matches would have a blue background or whatever).

Any ideas?

Dr. Rhomboid Goatcabin

Login or register to post comments
Hi There
richard.e.morton - February 10, 2009 - 22:18
Did you get a reply or discover an answer to this colour issue with calendar? I have found a patch for calendar 5.x but not 6.x and it really would be a cool feature so that it is easier to understand, like the event module.



Login or register to post comments
Hey all, is anybody here
yoda-fr - November 17, 2008 - 10:57
Hey all,
is anybody here know if is it possible to hide all the views week, year,.. and to make a direct link to the article from the calendar displayed.
Thanks for your help!

Login or register to post commentsremoving it
kurosevic - November 17, 2008 - 21:24
Hey fhsm,

your tutorial kickstarted my learning of views. thank you very much.

I've started creating variations of what you taught me with your tutorial, and and the calandar clone view you helped me create works well, however now i need to disable it because i have another one doing the same thing.

how do i disable it?

Login or register to post commentsMy Things Show Up Twice
MrBT - November 19, 2008 - 16:18
One problem I'm seeing is when I add something to a date, say today, and that thing happens in 2 months, then that thing shows up both today (where I don't want it) and again in 2 months (where I do want it).

What am I doing wrong?

Login or register to post commentsRSVP?
kurosevic - November 20, 2008 - 02:16
Does anyone know how to extend this event with an RSVP option?

I was thinking of making a custom poll that was selected in VIEWS and then just making it in the format

Q: Attending?
A: Y/N

while inheriting the event date as the time when the poll would close.


Login or register to post comments
Take a look at the SignUp
adamwebb - November 27, 2008 - 17:13
Take a look at the SignUp module.

Login or register to post commentsUse the RSVP module for
ulf1 - January 9, 2009 - 01:43
Use the RSVP module for invitations,
and use the views/calendar to show the events.


Login or register to post comments
Hours of the Day
mediamob - November 20, 2008 - 20:54
This is a really great write up that saved me hours upon hours of fiddling around with these calendar view arguments and what not I'm sure. Thanks fhsm for sharing this with the community.

The thing I'd really like to get out of this tool is for the calendar to display in week and day view with the hours of the day laid out. So, for example when something is happening from 12:00 - 15:00 you can see the rest of the day is open. This would be the final punch as far as I'm concerned to making this thing viable for a long list of solutions. Has anybody got it to do that yet?

Login or register to post commentsCalendar Day View Weirdness
ortizmj12 - November 24, 2008 - 03:19
First off, great write-up, fhsm! Very easy instructions to follow and work like a charm. I've just got one problem...

I've created a test event to make sure it was all working. I've noticed that when I bring up my calendar in a day view to look at my test event, the enlarged time in the left column does not match the start time for the event. Reference the link to see what I mean:

Anybody know how to fix this? Thanks in advance! :)

Login or register to post commentsDidn't work for me
atuline - November 27, 2008 - 17:05
This was a well written tutorial and I was doing great with a fresh/latest install of D6 (with 2.0 rc5 of date and calendar modules and CCK 2.1 and pathauto). I created an event content type and an article of that content type.

The problem started with the arguments panel in step 3.

The tutorial says:

In the Arguments panel
Click Date: Date (node.changed)
Near the bottom of the page under Date field(s):

uncheck = Node: Update date
check Content: Event Date and Time (field_event_datetime value)

I'm sorry, but there was no entry called Content: Event Date and Time (field_event_datetime value), nor any other 'Content' options.

At this point, the tutorial fell apart on me since I had no field to check.

Update: Also tried the latest dev versions of CCK, Date, Calendar, Views with similar results.

Login or register to post comments
Same here
layoric - December 1, 2008 - 21:35
Also didn't have the field_event_datetime value options listed. What gives?

Login or register to post comments
Did you make sure to create
ortizmj12 - December 11, 2008 - 03:48
Did you make sure to create the new field after you created the new content type? Only thing that comes to mind right now...

Login or register to post comments
Yes, the field was missing.
atuline - December 19, 2008 - 17:28
One important item missing from the original article was to add the Field to your Calendar View. So, prior to adding the argument as outlined in Step 3, you need to add the Field. So, while editing the new Calendar View I went to the 'Fields' selector and:

Click Add and select the following:

Content: Event Date and Time (field_event_datetime value) Default

Once I did that, the argument will now work as described.

Login or register to post comments
How to make a calendar of upcoming events
brecko - December 1, 2008 - 21:42
I followed all the steps. The Calendar itself works great.

However, when I click on the date of the event that was created in step 2, the calendar page for the day of the event comes up but it is empty.

Shouldn't the text of the event I created appear here? What am I missing?

Login or register to post comments
What does your fields
ortizmj12 - December 11, 2008 - 03:50
What does your fields section look like for that calendar view?

Login or register to post comments
dennots - December 3, 2008 - 20:55
Thanks for the excellent guide. It really showed me how to use the Calendar / Views.
This should definitely be added to the module help.

Login or register to post commentsSome Problems for my Calendar
hujia - December 7, 2008 - 02:29
Hello there,
Thanks for your excellent and detailed write-up! It serves for me both as a tutorial/learning documents and also very pragmatic instruction. I followed your instruction as given above carefully and closely to the letter for twice. I think i have succeeded in setting the Calendar in working nexus with the Event content and View correctly, with only one exception:
1) all the events I entered, like 12-26 and 12-25 (following the format given) all fell on the same day 12-06-2008 which is today as i type, regardless the FROM and TO times that I created for the Events. I checked the mysql, there are correct, in format of 2008-12-25 00:00:00.
2) The Events' titles show up correctly on the Calendar (though again on the wrong date). But, when I clicked on any of the events, which erroneously fall on 12-06, there is no description or detail which I typed. I am not sure if this is because the dates are wrong for Calendar in the first place? I tested the sql query for Views for these times, and they resulted in the correct times. but in Calendar, there are incorrect.

I am sure where goes wrong? Appreciate if you could help!

thanks in advance, hujia

Login or register to post comments
Please help with this Calendar of Mine ...
hujia - December 8, 2008 - 04:16
For the problems I reported here I found that the events are all located on the calendar according to their POST DATE, not FROM and TO dates. I check the setting for View and the event content type I created, as well as data for event, esp. FROM and TO, and cannot detect obvious wrong place... So if you could help me with this.

UPDATE: Hello, I would like to append this piece of information that may help for the user like me. What I found is there is a lacuna, or a missing step, maybe an important one at least for me, for the nice write up for setting the calendar up. It is the "Fields" configuration. Here is what I found as a necessary step to make the Calendar work: You need also, in addition to all the instructions given, to do the following forthe "Fields":
1. Click Add ... for Fields, and select the following:

Content: Event Date and Time (field_event_datetime value) Default
Content: Event Date and Time (field_event_datetime value2) Default

2. Delete (remove) the default item "Node: Published"

That would solve the problem I encountered. Hope that may help for somebody.

Best hujia

Login or register to post commentsSame problem as hujia but slightly different workaround
penteri - January 28, 2009 - 12:51
I've got the same problem as you: all my events' starting time fell on the current moment I was watching them. For example: an event's starting time is 2008-01-29 00:00:00 and ending time is 2008-01-29 01:00:00. If I check out the calendar for that event there is for the starting time current moment 2008-01-28 14:36:00. Ending time is however correct 2008-01-29 01:00:00.

My solution: In Calendar view's Fields-panel there were
1. Content: Event Date and Time (field_event_datetime value) Default
2. Content: Event Date and Time (field_event_datetime value2) Default.

I remove the first one
Content: Event Date and Time (field_event_datetime value)

When I check out the calendar for that event starting and ending time are correct
2008-01-29 00:00:00 - 2008-01-29 01:00:00

Login or register to post comments
I get to step 3 "Enable the
poobah - December 12, 2008 - 19:26
I get to step 3
"Enable the Default Node view: calendar (Calendar)
Clone the default view"

I don't see that as an option, mine goes from

Default Node view: backlinks (default) Enable
Path: node/%/backlinks
Block, Page
Displays a list of nodes that link to the node, using the search backlinks table.


Default Comment view: comments_recent (default) Enable
Title: Recent comments
Path: comments/recent
Block, Page
Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.

Login or register to post comments
Did you enable the
ortizmj12 - December 14, 2008 - 02:17
Did you enable the "calendar" module?

Login or register to post comments
Error Message on Step 2
bobwhitleyjr - December 30, 2008 - 16:29
When I go to create the content on Step 2 I get the following error.

warning: Missing argument 3 for content_permissions_field_access() in /home/whoyou/public_html/cms/sites/all/modules/cck/modules/content_permissions/content_permissions.module on line 21.

Did I miss something on the cck install/Setup?

Thanks for any help.

Login or register to post commentsThanks a ton!
ternto333 - January 7, 2009 - 22:13
You saved my bacon

Login or register to post comments...
seanmalley - January 27, 2009 - 16:50
This method worked perfectly for me, thanks for the well written instructions! I do have one question though...when I was entering a test date into the calendar, it appeared like the time was showing up incorrectly in the calendar view for me, but showed correctly when clicking on it. After some messing around with it, I figured out it was just displaying the time I "created" the actual event on the calendar, not the time of the event. Is there any way to remove this, or at least have it show the event's actual time on the calendar instead?

Login or register to post comments
error after adding "sort" criteria
cdragin - October 28, 2008 - 20:19
I followed the instructions but get this error after adding the sort criteria:

user warning: Unknown column 'node_data_field_datetime_field_datetime_value' in 'order clause' query: SELECT node.type AS node_type FROM node node LEFT JOIN content_type_event node_data_field_datetime ON node.vid = node_data_field_datetime.vid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE 0 ORDER BY node_data_field_datetime_field_datetime_value ASC in /home/icatri/public_html/drupal/sites/all/modules/views/includes/ on line 727.

Seems to work without adding any sort criteria, so I will remove it and hope for the best.

Login or register to post commentserror after adding "sort" criteria
cdragin - October 28, 2008 - 20:20
oops, sorry for the duplicate entry

Login or register to post commentsdates are off-kilter
Dr. Rhomboid Go... - November 2, 2008 - 00:50
Tremendous write-up -- I would've been flailing in vain for hours, however I ran into a problem. When finished, my calendar shows the week running from Monday thru Sunday (any way toi change to Sun thru Sat -- I couldn't find anything for this, but I'm new to this module).

Also, it shows that Nov 1, 2008 is Sunday (when its really Saturday all dates are offset by +1), and the pink highlighted box indicating today (I think), is on Nov 2, 2008 (when its really Nov 1, 2008).

How I can fix...?

Dr. Rhomboid Goatcabin

Login or register to post comments
Dr. Rhomboid Go... - November 2, 2008 - 14:35
If anyone out there sees the same thing, all I did to fix was wander into Administer>>Site Configuration>>Date and Time. I had set all this originally, and when I went there, I didn't change anything, just apparently had to open and save again.

Again, kudos to fhsm, brilliant write-up -- thanks for letting everyone benefit from your experience.

Dr. Rhomboid Goatcabin

Login or register to post comments
example upcoming events block
dugh - November 3, 2008 - 03:00
If you want to just show upcoming events, remember to filter by event dates >= now

I created an upcoming events block using date/calendar/views2, see: (block on right) (regular calendar view)

The one extra thing I did was give each group their own calendar, and let people filter the calendar view by group. To do this I had to hack og, the simple patch wasn't understood by the og maintainer:

Login or register to post comments
Great example!
justageek - November 3, 2008 - 14:39
Your site / example is great. My calendar view uses the dhtml / ajax popups when you click and event, and I can't quickly figure out how to turn that off.

Good stuff, though.

Login or register to post comments
off w/ popup dates
Dr. Rhomboid Go... - November 3, 2008 - 23:22
I'm no expert, but I think I know the answer, on your Module page, under the 'Date/Time' twistie, disable 'Calendar Popup'. That's how I did it at least.

Dr. Rhomboid Goatcabin

Login or register to post comments
@dugh - any interest in walking through those OG tabs!? (offtopi
zilla - November 4, 2008 - 03:14
sorry, not meaning to hijack this issue BUT i am trying to do exactly what you're doing with those tabs on your groub home pages - is that via a module? could this also be done with tabs in views? i'm still having trouble with both....

thanks in advance for any insights ;)
i love to waste time:

Login or register to post comments
yeah use views and arguments
dugh - November 6, 2008 - 21:13
Yeah use the special $group argument like so:

Check provide page view.

Set the url of the page view:

Under the 'menu' section check
'Provide Menu'
'Provide Menu as Tab'
(or at least the 2nd one?)

Set the menu title ('Calendar') and so forth.

In the arguments section, make the first argument:
OG: Group nid(s)

I am using drupal 5 on that site, I haven't tested group tabs in drupal 6 yet. I hope they still work.

Login or register to post comments
vjordan - November 6, 2008 - 15:15
dugh - you have a very clean looking theme there. Well done.

Can you explain how you did the upcoming events listing? Is it a single block view used in both the right sidebar and on calendar/upcoming? Did you base the view on a cloned calendar view or did you craft the view from scratch? If the former, could you explain how you eliminated the calendar navigation information - through theme changes or view configuration?

If you crafted from scratch, how did you configure it so that repeat events are shown with the correct date? I've tried this approach and can't get repeat events to list against the repeat dates - I only seem to get the date of the first event.

Login or register to post comments
dugh - November 6, 2008 - 21:17
The upcoming block and page is a new view.

The block is a table view with these fields:
and Date: Date (field_eventdatetime in my case)

I filter by
Node Published = yes
Node: Type = my event node type
Date: Date - Date (field_eventdatetime) is greater than or equal to now (actually 'now-1day' so events don't disappear the instant they start).

And I sort by:
Date: Date (field_eventdatetime) ascending

I'm not sure how to fix the repeat date issue. I would create a new support request for the date module, and KarenS or someone can likely help.
But look through the calendar and date configurations for help too.

Login or register to post comments
Dugh, can you explain how
jeremy_a - November 6, 2008 - 21:37
Dugh, can you explain how you achieved both putting your main calendar at & then Upcoming at I'm trying to replicate this pattern but the main calendar view overrides the upcoming because the view expects as an argument, not "upcoming"


Login or register to post comments
don't know
dugh - November 9, 2008 - 04:44
Sorry, I don't know why it wouldn't be working for you.

A few things (just grasping at straws):
-My argument looks like /calendar/2008/11 not /calendar/2008-11
Don't know if that makes a difference.
-Maybe the order of the views or the order of the URL aliases (/admin/build/path) has some effect, I don't know.
-Also, I am using global redirect, which forces one alias per page/node/view.

Login or register to post comments
I see
vjordan - November 7, 2008 - 11:05
Thanks for the details dugh. I see ITLS is built on D5. I'm tackling this problem on D6, views2 and it works somewhat differently.

In the meantime I've discovered KarenS has done some work here ( I've downloaded the dev version which includes a default "upcoming" block. Not helping a lot (yet) as I'm getting WSOD but hopefully I'll be able to troubleshoot that.

Login or register to post comments
can someone provide a
bjraines - December 31, 2008 - 00:09
can someone provide a working view that lists entries by the time they are put on and not the time the node was created?

Login or register to post comments
Thanks for the above
didymo - January 6, 2009 - 21:23
Thanks for the above howto.

I had the calendar working very rapidly.

However after spending quite a few hours over a cuople of days I am clearly not doing something correctly in the Upcoming Block View.

I have set the date format to be dd/mm/yyyy. This works throughout the site, and in the views calendar. However no matter what I do the date of the event in the upcoming is registered as mm/dd/yyyy. I even removed the modules and started form scratch, more than once. I have emptied the cache tables. I just really do not know what to try next. This is clearly my fault. As everything else just works i have no idea what I mucked up.

Thanks to anybody with suggestions.



Login or register to post commentsbroken in latest date/calendar drupal 5 modules
dugh - January 12, 2009 - 17:22
I upgraded the date and calendar modules the other week, and not repeating dates just show the first instance. So now my upcoming events block is broken. I reported the bug here but nothing came of it:

I usually test it out first on a staging site, but our server admin had everything else down.

When I upgrade to drupal 6 this summer, I'm probably going to just use the event module instead. It appears to be more stable now (although 6 months ago the reverse was the case).

Login or register to post commentsMy Filters look like
kwgossett - January 20, 2009 - 03:48

My Filters look like this:

Node: Type = Event
Node: Title != something_I_wanted_excluded
Date: Date Content: Start Time (field_time value) >= now - 1day
Node: Published Yes

yet, my upcoming events view still shows past events.

I notice that you have:
Date:Date - Date (field.....) vs. my
Date:Date Content: Start Time (field....).

I've got no idea what's going on, or how to remove past events :(

Any ideas?

Login or register to post comments
refresh maybe
dugh - January 25, 2009 - 04:41
you may need to clear your views cache - go to the tools tab under views to see a button to clear the cache.

or check for typos perhaps? like "now - 1 day" instead of "now - 1day" which might not be parsed correctly perhaps

Login or register to post comments
I have the same issue, that
ulf1 - February 12, 2009 - 21:10
I have the same issue, that older events still show up.
Clearing the cache did not help.

Interestingly if I display the query, like followed, it replaces "now" with '2008-11-01', and that causes the problem, but I am not sure how to tell the view module to use the current date .


SELECT node.nid AS nid,
node_data_field_startdate.field_startdate_value AS node_data_field_startdate_field_startdate_value,
node_data_field_startdate.field_startdate_value2 AS node_data_field_startdate_field_startdate_value2,
node_data_field_startdate.field_startdate_rrule AS node_data_field_startdate_field_startdate_rrule, AS node_data_field_startdate_delta,
node.title AS node_title,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node_data_field_startdate.nid AS node_data_field_startdate_nid,
node.type AS node_type,
node_data_field_highpriority.field_highpriority_value AS node_data_field_highpriority_field_highpriority_value
FROM calheat_node node
LEFT JOIN calheat_content_field_startdate node_data_field_startdate ON node.vid = node_data_field_startdate.vid
LEFT JOIN calheat_content_field_highpriority node_data_field_highpriority ON node.vid = node_data_field_highpriority.vid
LEFT JOIN calheat_node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE ((node.type in ('calheatevent')) AND (node_data_field_highpriority.field_highpriority_value <= 2))
AND (DATE_FORMAT(ADDTIME(node_data_field_startdate.field_startdate_value, SEC_TO_TIME(-28800)), '%Y-%m-%d') >= '2008-11-01')
ORDER BY node_data_field_highpriority_field_highpriority_value ASC, node_data_field_startdate_field_startdate_value ASC

Login or register to post comments
weird timezone issue
jewhite - January 8, 2009 - 04:20
First of all .. great write up. Breaks it down nicely ... but not too simple to obfuscate what *can* be done ...

My Time zone was 5 hours off (I'm at GMT -5 ... EST) in the display of events. The machine is set to American/New York (EST), Drupal is set to America/New York, User is the same and the event is posted as America/New York. Whenever I saved an event, it incremented the time up 5 hours (to GMT). I turned off user configurable time zones and now it holds time correctly. Anyone else experienced this or have an idea as to why?


Login or register to post comments
Extra Help
fhsm - January 10, 2009 - 23:03
Hi All -

Looks like this thread hit a bit of a nerve with people. I've had a number of folks send me messages asking particular questions. Unfortunately I included 100% of what I know about this problem. Sorry to not be more help. Perhaps someone more active in the involved projects could document this use. Mine should not be the definitive word on how to accomplish this.

Login or register to post comments
repeating events
beg - February 20, 2009 - 20:46

While configurating the event page I run into some new questions:

How can I support the creation of repeating events with cck/date/calendar/event modules? e.g. similar events every week, same day, same time. I have to have the possibility to create day/time once and say to repeat every weak, since it's no option to do that for every week manually.

and/or is there any possibility of "saving" kind of templates for events in order to save basic information of a repeating event and just creat a new entry by adding date/time information?

Background is a calendar for new and repeating events. (different events each of them being the same event, same description, weekly with some breaks for holidays..)

I also tried to get different colors for the different events with the node.color module, which would be very usefull. I created different event types with different colors, but they still dont show up in different colors in the Calendar..


Login or register to post commentsDon't use the date and calendar module
dugh - February 27, 2009 - 15:54
In Drupal 5, repeating events broke 3 months ago, and bug reports for the drupal 5 version of the date module are pretty much being ignored now.

If you are stuck like me, you'll have to downgrade to a version of the module before November 2008.

No comments: