I have a custom module (rbookapi) with a simple table containing dates (rbookapi.start, rbookapi.end : both DATETIME). I'd like to display this information in a calendar view using FROM and TO dates. This can be achieved for CCK types but I can't find how to do it for custom modules.
Steps taken so far
1. Created a Calendar styled View which shows the rbookapi records based on start date (rbookapi.start).
2. Searched advanced help, forums, etc on how to add a TO date (rbookapi.end).
3. Looked at Date and Calendar code which seems to use fromto[0-1] in order to manage this in CCK types.
Some clues
- I can hardcode dates into fromto[] in Calendar.module which then displays in the view. Obviously I need a way to do this without hardcoding.
- I think hook_date_api_fields is where I should specify my FROM and TO dates.
- There must be some way of linking two Date fields (ie. FROM, TO), or combining to table columns (ie. rbookapi.start, rbookapi.end) into on Date field. But how?
So the question is...
- How can we specify to Date/Calendar/Views that two DATETIME fields in a custom module should be considered as the TO and FROM dates for the Calendar Views display?
Thanks in advance.
Versions
- D6
- Views 2 latest
- Calendar (latest D6 -dev : 6.x-2.x-dev)
- Date (latest D6 -dev currently 6.x-2.x-dev)
| Comment | File | Size | Author |
|---|---|---|---|
| Calendar Date with Custom Modules 1.jpg | 73.06 KB | bbeeson |
Comments
Comment #1
bbeeson commentedThis issue is more or less a duplicate of http://drupal.org/node/320596, although you wouldn't guess from its name!
I'm posting a solution there.
Comment #2
bbeeson commentedI think I should close this.
Comment #2.0
bbeeson commentedUpdated to reflect further progress made in solving.