I'm fairly new to Drupal, very new to CCK and Views, and very new to Date. I've searched around and found similar things to this, but not quite this.
I'm trying to use the Datestamp CCK field (with selector drop-downs) to create event nodes. I'd really rather not use the event or calendar modules (they seem a little heavy since I don't need calendar style views, just a simple list will do). I'm 90% of the way there, just that last little bit of theme magic is what I need.
I'm not using multiple values but do have the "To Date" set to optional. The time zone is set to site.
I'd like the possibility to create different time spanning events:
1. Single Day - All Day Events
2. Single Day - Non-All Day Events (i.e. 9:00AM - 10:00AM)
3. Multi-Day - All Day Events
It basically comes down to needing to be able to hide certain information.
For example, if a user wants to create a single day all day event, they simply leave off the end date and set the start time to 00:00. I then need to hide the display of "12:00am" when the node outputs.
If a user wants a single day Non-All Day event, I would like to hide the date when the end time outputs. Rather than output "January 22, 2008 - 12:00pm - January 22, 2008 - 1:30pm" I'd like it to output "January 22, 2008 - 12:00pm - 1:30pm".
I imagine this is fairly simple, it's just a matter of knowing what theme function to call.
Comments
Comment #1
dperdue commentedI think I've answered my own question. It has to do with the
theme_date_display_combinationfunction. I'll post the completed code here when I get it all figured out.Comment #2
dperdue commentedHere's the code I came up with.
The only thing I still don't understand is why I had to use db->timestamp instead of local->timestamp to make it work correctly.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
jfall commentedThanks a ton for the ideas dperdue. I used them to develop a handbook page for the date field documentation...
It provides a different algorithm that is (perhaps?) a little easier to modify to suit other specific needs, and attempts to preserve the short/med/long date formats set by the admin wherever possible.
http://drupal.org/node/235662
Thanks again for sharing your code.
Comment #5
dperdue commentedI stumbled across that handbook page the other day and thought "why didn't I see this before?" Now I know why. Thanks for cleaning up the code and making it a little more adaptable.
Comment #6
jimijamesi commentedhow would we hide this time info info for the calendar month view??
Comment #7
momper commentedi asked there: http://drupal.org/node/235662
is there a solution for 6.x? or is it functional for 6.x?
thanks momper