Views Calendar

KarenS's picture

I have a mostly-working Views Calendar module available at http://www.drupal.org/project/calendar. It's still a little buggy and the css needs tweaking but it is generally working. Create a view and select the Calendar display (instead of table or teaser). Add any date field to the view (CCK dates, event dates, node updated dates, whatever). Add three arguments, Calendar: Year, Calendar: Month, and Calendar: Day.

Navigate to the view where you will see a year of mini calendars. Click on a month name to see the month or a day name to see the day. Back and next navigation is provided for month and day views (not yet added to the year view). It comes with a default calendar that displays all nodes in a calendar by their last updated dates. If you like, select the Calendar view for the block, too to get a mini calendar in a block.

This was carved out of Event Views and includes the event calendar api and many of the event themes, all modifed to eliminate any reliance on the event module.

My plan is to get this working in 5.0 as soon as the preliminary bugs are worked out of it (because I need a way to do calendars in 5.0 without depending on the event module).

Comments

Actually, disable event

KarenS's picture

Actually, disable event views to test this because the original version is still in that module and there will be conflicts. That means you can't test it with event fields until I remove the duplicate code from the event views module, which I will do as soon as this seems to be working fairly reliably. Then anyone who was using that feature in event views can get that functionality (and more) from this module.

Do you have a demo

merlinofchaos's picture

Do you have a demo somewhere?

Not yet. My demo site needs

KarenS's picture

Not yet. My demo site needs an overhaul so I can't put it there until I get that done.

How To?

offal's picture

I'm quite new to drupal and just trying out Drupal 5 and this Calendar module. Unfortunately I don't quite know how to use it. I managed to install it to look like on your demo site, but how do I configure Calendar to enter some events on particular dates? Is there a function for repeat events? Is there a more detailed how-to somewhere? Would appreciate any help or links to how-tos.

See my response at

Demo working

KarenS's picture

Finally got my demo site re-hauled and I have a demo of this on it. You can see it at http://www.elderweb.com/demo/calendar.

That...is...awesome!

merlinofchaos's picture

I love it. This is the piece i've been wanting pretty much forever.

Looks great!

Amazon's picture

Hi Karen, your demo looks great.

Thanks for building this out.

Cheers,
Kieran

To seek, to strive, to find, and not to yield

Support the Drupal installer, Install profiles, and module install forms

Fantastic

Boris Mann's picture

Excellent work, Karen. Bu-bye, event, now we just have to work on views_ical....

Put me down for "Would like to buy Karen a beer (and meet her in person)".

Thanks! I'm hoping to make

KarenS's picture

Thanks! I'm hoping to make it to the next DrupalCon cause I'd like to have a chance to meet everyone in person myself. :-)

It's not quite bye-bye to event yet. I still need to create a way using the Date module to link a from and to date together so the calendar knows it is a date range instead of two separate dates. I'm not sure yet how I'm going to do that, I'm playing around with a couple possibilities.

Also, I still have quite a few timezone fixes to make in the calendar, which I'm slowing slugging through. You have a lot of possibilities -- event module dates have three possible timezone options (site, event, and user), the date module has four (date, site, gmt, and none), and regular timestamps have at least one (site), so you have to sift through all the possibilities both when do the queries and when displaying the results. When you look at a year or month calendar it looks reasonable, but when you dig into each individual date there are still places where it's not right yet.

Just set this up, and it it

Anonymous's picture

Just set this up, and it it totally great!
The timezones still needs the fixes I see - I could only make it work correctly when the field was set to site timezone, and I had an (impossible, it seems, to reproduce) issue with calendar blocks doubling up (one listed without a title).

Thanks for your great work kicking Drupal events into the 24th century :)

as an event module replacement

Development Seed's picture

Hi Karen,
This looks great. Is the issue resolved with the date range yet? Also, are there any other known issues you see for using this as an event module replacement, or a reason why you would not want to replace the event module with this?

Thanks, the views plugins you are doing are awesome (and if I never said it - so is views itself! :))! I was trying out views_calc, it's pretty cool.

Ian

I am realizing there are

Development Seed's picture

I am realizing there are things that plug into the event module nicely. I'm sure things can plug just as well into the calendar module. There is:

What else is working with the event.module? Just trying to outline what's out there w/ the idea it will be helpful in deciding what to use and what else could be plugged into the calendar module API.

Ian

Gardening..I Just found this

Development Seed's picture

Gardening..I Just found this from Mike and Kieran in regards to eventfinder and comparable abilities to do the same w/ views, etc. http://groups.drupal.org/node/1652

Date range changes started

KarenS's picture

I just committed to the HEAD version of the Date module changes to allow you to set 'from' and 'to' dates in a field. Once I get the bugs worked out of that and get it ported to the other branches, I should be able to alter the Calendar code to treat them properly as related dates and display them on the calendar the same way events are displayed.

Use cvs version of Event Views

KarenS's picture

I got the duplicate code carved out of the cvs version of the Event Views module (which is still targetted for 4.7), so you can now use that to try adding event fields to the calendar.

Event calendar api?

gusaus's picture

When you mention event calendar api, does that mean that this will integrate with services such as Upcoming.org or Eventful? It looks like a lot of work has already gone into this?
http://drupal.org/node/24111
http://drupal.org/node/29784

Gus Austin

I started with the api in

KarenS's picture

I started with the api in the event module because that was the easiest way to extend this to work with dates from other sources. I did have to modify it a bit to get it to work the way I needed it, but it is pretty close to the original api. I wasn't aware of the projects you link to and that wasn't my reason for using it, but if they use the api in the current event module, I imagine this could be made to work.

Hopefully at some point...

gusaus's picture

Thanks Karen - It looks like, at this point, there isn't that much interest in this type of third party API integration. Seems like this would fit in nicely with the great stuff you're doing. Thanks!

Gus Austin

How to maybe do hCalendars?

tanepiper's picture

I have recently done a post here on how I would like to do hCard, and I think something similar can be done with Calendar. I'd like to use the calendar API instead of events, because as you say you want to display objects that are not just events, but includes dates from the CCK.

And I think that including the hCalendar in the calendar event will allow for the creation of a hAtom stream that people can subscribe to using an calendar aggregator.

It's certainly something we can discuss and hopefully work on.

Tane Piper

Digital Spaghetti

Calendar link path

hairylunch's picture

I started playing around with this a bit, and it seems great.

The one issue I've run into is that the path for the links in the calendar seem to be hardcoded? In other words, I must specify "calendar" as the URL when I create a view.

I'm relatively new to Drupal, and not much of a coder . . . this might just be a config issue on my end.

Nope, the path should not be hard coded

KarenS's picture

No, there was some 'calendar' stuff left in there accidentally, it wasn't supposed to be there. You can create your own paths depending on what url you give your view, and you can have multiple calendars for different purposes each with their own url.

I just did a commit to clean up some of the hardcoding. There may be more that I haven't found yet, though.

The HEAD version of this

KarenS's picture

The HEAD version of this module is now ported to 5.0.

Karen, Great, Good job

drupalcat's picture

I have published our events in the year (12 months) calendar.
I have added (ADD ) the start date to see the distribution and manage the news.
It look nice and professional.
Ferran

en Ferran Cabrer i Vilagut - Skype: Ferran.Cabrer
CONSEN.org - Euro-Cluster Pro-Information Society
MUFICATA s.l. - Natural Information Environments
T1:+34 934238267 T2: +34 93 423 9164 M:+34 600649364 F:+34 934233430
Jaume Fabra 12 08004 Barcelona

help for Calender for Drupal

carnium's picture

Hi,

I need your advice.
Our page is carnium.si
How can I:
- enter some events to Calender?
- change the Name of "Month" to "Mesec" (slovenian word for Month)

Thank you for your help.
If you ever come to Kranj (City), Slovenia, Europe, please, contact us, bier & coffe is waiting for you :)

Best regards!

The calendar just displays

KarenS's picture

The calendar just displays events you already have created, it's not a system for creating them. Create them as you usually would using either the event module or CCK and the date module. For other help, you can post issues on the issues queue at the Calendar project page (http://drupal.org/project/calendar).

Theming Calendar VIews

gmak's picture

KarenS,

Let me start by chiming into the praise for all the work you've done on this addition to Views. The flexibility offered by the Calendar module over the current output from the Event Module, is already proving invaluable to the development of our site. The ability to filter a calendar view based on multiple taxonomy is something that I've been trying to achieve (and failing) for ages now.

I'm wondering about how we can theme the output. I note that the calendar_api.inc includes a variety of theme_X functions which mirror (to some degree) those found in the Event Module. However, if I try to theme these by copying the function to template.php and renaming it to phptemplate_X, I am not seeing any change in the output.

Is there some other process for theming output from Calendar?

Thanks

The default in that theme is

KarenS's picture

The default in that theme is to just display whatever non-date fields you add to the view, one on top of another. You can override this theme to do whatever else you want to do. If you see ways to improve the process, or info you need for your theme that is not available, post something on the issue queue.

At the very bottom of calendar.module you'll see the function you can theme:

<?php
/**
*  Themeable node display
*
*  appends the field name to the title
*  constructs a teaser out of any non-date fields in the view
*/
function theme_calendar_calendar_node($node, $type) {
  
$node->title = $node->title;
   if (
$node->label) {
    
$node->title .= ' ('. $node->label .')';
   }
   if (
$node->fields) {
     foreach (
$node->fields as $field) {
      
$node->teaser .= '<div>'. $field .'</div>';
     }
   }
   return
theme($type, $node);
}
?>

And I see I did not document this, but $type is the theme: 'calendar_node_month', 'calendar_node_week', 'calendar_node_day', or 'calendar_node_year'.

Updated:I have cleaned up this theme a bit and changed the above to match the way it now works. Also I started a documentation page at http://drupal.org/node/120710.

Different type of cck node in calendar

coolin's picture

Hello,
first of all thank you very much for this very nice module. Secondly, I am very sorry to post this question here if already answered elsewhere. In fact I found that it is rather difficult to find nice faqs/examples/tutorials on most of drupal related things.

I am trying to make a calendar for my lab's seminar schedule. There a 2 types of seminars created through CCK type, let's say CCK type A and B.

I can have a nice view of all CCK type A, by creating a calendar view with the filter: "Node Type is one of A". My problem is how can I simultaneousy view the CCK type A and B (as written in the view page: "Filters allow you to select a subset of all the nodes to display. All Filters are ANDed together.". If I add a filter for A and B, I get nothing).

I tried to create a category seminar and assigned A and B to the category seminar. If I filter by category of type seminar, I obtain nothing.

any solution?? thank you.

Other question: how is it possible to have different format of the cck node depending of I am in a month view or a day view? (When browsing per month, too much information appear)

thanks,
colin

Just choose the 'OR' option

KarenS's picture

Just choose the 'OR' option on your filters -- so it is Type A OR Type B.

coolin's picture

Hello and thank you for your reply,
in fact it took me 5 minutes to understand it. It is clearly written in the admin page of a view at the place "filters" that "All Filters are ANDed together."
After a while i remarked that when selecting the filter "NODE TYPE IS ONE OF..." it is possible to select multiple types by using the SHIFT or CONTROL key. I think that this is what you was suggesting. Anyway, this works.

The second question comes:
How to customize the calendar view such that when appearing in the month view, fields displayed are a small subset of the fields appearing are different that the fields appearing in the day view. Again, I am sorry to ask that since it seems an obvious question, but I have found no previous post on that. Is there a way to customize the view somewhere in the php code or anywhere else?

thank you,
colin

Check out new documentation

KarenS's picture

Check out new documentation at http://drupal.org/node/120710.

I continue my question in the tutorial page

coolin's picture

... i still have some problems (it mostly works but....).... i ask them in your tutorial page

thannks
colin

Add ical feeds to calendar

KarenS's picture

Just added a very beta feature to the HEAD version of the Calendar module -- add ical feeds to the calendar. Tested with the feed from the Drupal Groups calendar and Google Calendar. I got both of them to display on my calendar along with the events I had in my database.

You need to use http:// instead of webcal:// as the url for the Drupal Groups calendar. Events added from Drupal groups contain links that take you back to the event on Drupal Groups. The ics file produced by the feed doesn't show all the items you see on the Drupal Groups calendar for some reason, but the Calendar module will display whatever items come across in the ics file.

The Google Calendar items display fine on the calendar, but the Google ics file has no urls in it and I can't find any way to link back to the individual Google calendar item.

I'd be interested in feedback and testing.

Updated:

Just tested this with an ical feed from upcoming.org and feeds from there can also be added to the calendar! Again, you have to change webcal:// to http://, so it looks like that is just going to be the standard way to get it working.

iCal feed demo

KarenS's picture

I have a demo of the calendar picking up ical feeds now working at http://www.elderweb.com/demo/calendar. It is bringing in a feed from Drupal Groups and from Upcoming.org.

Great to see this

ChrisBryant's picture

Thanks for sharing the link. This is really sweet, I'm looking forward to testing it out.
Chris

ALIAN DESIGN

this replaces event?

pwolanin's picture

I haven't tried it yet, but from the description it sounds like this will/can totally replace the event module for 5.x? Is that right? Is there some particular functionality in event that's not going to be available with calendar?

Potentially for at least

KarenS's picture

Potentially for at least some people, yes. I think that killes is still planning to continue development on the event module, so it's not going away. Here's how I would compare things right now:

1) Event module is more of a turn-key solution -- you install a single module that allows you to create events and display them in calendars. Calendar is only a solution for displaying calendars, you need another module (probably CCK and the Date module) to create the events, so it's more of a roll-your-own solution. You actually probably need at least four modules -- Views, Calendar, CCK, and Date.

2) Event has basic functionality -- current dates that are stored as unix timestamps that can be entered using a drop-down selector or jscalendar. The Date module has lot more ways to configure the selectors and more input options (like a textfield that interprets strtotime). It also can create either unix timestamps or iso date fields and will support historical dates if you use the adodb library. So Date + Calendar has more flexibility if you want something different that what you can get with the Event module.

3) The Event module is stable and has been around for a while. Date and Calendar are both new modules under active development, so you have to keep up with the changes until they stabilize.

4) Because it has been around for a while, the Event module has lots of add-on modules that work with it to do repeating events, invitations, etc. Many of those kinds of add-on solutions are not yet available for the Date + Calendar combo, although there are people thinking about and working on some of them.

Walt Esquivel's picture

Hi Karen,

Thanks for ALL your excellent work - - - the community truly appreciates it!

Regarding the Event module, I was looking through the excellent new way of listing all the modules running on my website, e.g. http://mysite.com/admin/build/modules, that dww (Derek) was largely instrumental in implementing just before the 5.0 release. The new way of listing modules is terrific in that it lists modules dependent upon or required by others. I'm running the OG calendar module and I noticed the following:

OG calendar: 5.x-1.0. Depends on: Organic groups (enabled), Event (enabled)

Also, under the Event module, I noticed the following:

Event: 5.x-1.x-dev. Required by: Basic event (enabled), Event Views (enabled), Event Repeat (enabled), OG calendar (enabled)

So, it appears to me that the OG calendar is at least one module that depends on the Event module, so folks might want to take this into consideration if they're running or plan on running OG calendar. Since I've only installed about 70 (70?!?! Yes, 70!) contributed modules, here may be others that depend on the Event module that I'm unaware of since there are over 300 contributed modules.

I'm not a developer but if anyone reading this is working on enabling a combo of Calendar, Date, CCK, and Views that will NOT include the Event module, perhaps the dependencies issue has already been addressed? Perhaps dependencies issues is something that developers automatically take into consideration when coding a module that might take the place of another?

Thanks in advance for any insights!

Walt Esquivel, MBA; MA; President, Wellness Corps; Captain, USMC (Veteran)
$50 Hosting Discount Helps Projects Needing Financing

Walt Esquivel, MBA; MA; President, Wellness Corps; Captain, USMC (Veteran)
$50 Hosting Discount Helps Projects Needing Financing

You can get a calendar that is group specific

bonobo's picture

with Views Calendar by setting an argument within the view to filter by the nid of a specific Organic Group --

Cheers,

Bill

Group Name?

skor's picture

Has anybody hacked OG to expose the Group Name to Views?

Kudos on a great module/views combo!

texas-bronius's picture

Karen- Wow, what a great module combo!
I am just beginning with Calendar/Date, and it is a breeze to work with. I felt it prudent to offer you some praise especially based on learning of your "humble php beginnings" from that one lullabot podcast a couple months ago. This is some complex development, and it looks like it has come a long way. Kudos!
-bronius

Question: can each user have a public calendar?

jcheak's picture

Hi All,

Please forgive my ignorance since I am new to Drupal...

If I installed this module as is, does it have the ability to give each user a public calendar which everbody else
can see? Or would I need something more heavy like the k5n calendar?

The goal: you can see that user1's calendar and user2's calendar is also public for all to see so you can see who is busy and who is available....

Thanks,
Jeff

Quick Calendar Question

kdavis005's picture

Hello,

I have the calendar module installed on the site that I'm working on. I would like to know if it is possible for me to add an event based upon the day the user selects. For example I'm looking at November 30th and I would like to add an event for the day only. I would I go about doing that?

Thank you........
Kevin Davis

I think this will involve

dwees's picture

I think this will involve coding a special module to do this.

Basically you create a module:

It defines your_module_name_form_alter and your_module_name_block. The block defines a special link with an additional argument being the date of the current calendar view (which presumably it gets from examining the argument of your current url). The _form_alter hook uses the incoming arguments, and if they are present, sets the date field of your new event node to match the arguments.

The tricky part here is that the exact code will depends on how you have defined your calendar view, and what the field name is for your date field attached to the event node.

Dave

I'm working (very slowly) on

dwees's picture

I'm working (very slowly) on an installation profile, and I'd like to include the Public Bookings module, which depends on the Views module for the display of its information. I've got a working version of the Public Bookings module, which relies on the Bookings API module and a patched version of the Date module and Calendar module.

The only problem is, I can't figure out how to have a custom date field for the Publing Bookings module be displayed using the Calendar.module. It seems that the possible choices for the Date argument that the Calendar module are hard-coded somehow or I'm just not aware of how to expose my date field to the Calendar module.

Any suggestions?

David, Thank you for your

kdavis005's picture

David,

Thank you for your answer, I'll give it a shot!

Calendar that allow user to schedule an event

imeles01's picture

I've built my first calendar. What I need is for a user to select a data and schedule bike rides. Will I be able to do this with Calendar + Views?

Link single node from Calendar block

giulio.biz's picture

Hi great Group!
I use Calendar+Views modules with huge satisfaction.
After googling for a good solution with no success I'm here to submit to your great experience my questiion:
How link my calendar block directly to a single Node?
My site has only one event listed per day in the calendar.
when I click on one day (in the block) i would like this link takes me directly to the node and not to the calendar page, to avoid user to click a sencond time on the "event" title.
Is it possible?

Link single node from Calendar block

Oscar_Huerta's picture

I've done this...
create a calendar-datebox.tpl.php file in your theme folder, and override the output with this:

<?php
print $selected ? l($day,$items[$date]["00:00:00"]["0"] -> url) : $day;
?>

It will print a link to the node... use devel to get the $items value that work for you

Hope it helps

Use array index instead of key?

gradynoonen's picture

Any idea why this won't allow me to use array indexes rather than keys? For instance, I just want to link to the first item for a given date by doing this:

<?php
print $selected ? l($day,$items[$date][0][0] -> url) : $day;
?>

but it doesn't like it. It only works if I use the exact position key.

Solved

gradynoonen's picture

I figured it out. PHP doesn't work that way with indexes and keys. Here's my solution if anyone is interested. I haven't tested it for multiple items in a day.

<?php
$time
= key((array)$items[$date]);
print
$selected ? l($day,$items[$date][$time]["0"] -> url) : $day;
?>

Views Developers

Group organizers

Group notifications

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