Closed (fixed)
Project:
Calendar
Version:
7.x-3.0-alpha1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2011 at 21:59 UTC
Updated:
13 Jan 2012 at 21:10 UTC
Hi,
I've looked around quite a bit for someone doing this successfully and have not seen any posts. I have a table created by a custom module and have integrated it with views and date via hook_views_data. Have been able to make views with date browsers successfully. I'd like to be able to display this data in calendar views. I tried writing my own style and row plugins, but feel like at that point I'm getting close to reinventing the wheel. I didn't have much luck anyway, which may be related to the 'only works with 'node' as base.' comment. Any suggestions on a strategy here? Been really impressed with the 7.x-3.x release. Thanks for the hard work.
Comments
Comment #1
karens commentedYou should be able to use any Views field that extends the date handlers. So if you have a custom field you need to make sure it is set up to be integrated into Views. I assume you already have done that or you would not expect to be able to use it in a calendar. The easiest method is to give your field a views filter that extends either the basic Views date filter (if you have a simple unix timestamp field that looks like the core date fields) or Date View module's date_views_filter_handler_simple handler. Then implement hook_date_views_fields() in your module to tell Date Views how your data is constructed (see date_views_date_views_fields() for an example of how it is implemented for the core date fields like post date). That should be enough to make your fields available to use in a calendar (if nothing else, they should show up as available fields in the Date argument and filter and you can check them off).
This is not tested recently, but should work. If you see any tweaking that is needed you can post patches. If you get it working, please contribute some documentation for others, since I haven't had time to do that.