Closed (fixed)
Project:
Event
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2008 at 02:08 UTC
Updated:
15 Dec 2008 at 14:52 UTC
Jump to comment: Most recent file
Comments
Comment #1
frank ralf commentedThat is not an event specific problem. Just go to the date/time settings of Drupal and change the "short date format" to your liking (i.e. only date, no time). That's the one event uses for display.
Frank
Comment #2
jdsaward commentedI want it so that:
Possible?
Comment #3
claudiu.cristeaUnfortunately is a Event specific issue...
Changing the format in the site settings will not help while this is gonna change the date/time format on the entire site...
Comment #4
domesticat commentedI disagree with the solution set out in #1. Yes, changing the format of the short time does eradicate the problem, but it's a fix that causes more problems than it solves. It changes the date display format for all events, not just the ones that shouldn't have an end time.
Comment #5
frank ralf commentedSorry for the misunderstanding. Of course that's only a quick hack or workaround.
I found a patch here (but haven't tested it yet): http://www.drupalcenter.de/node/13362
hth
Frank
Comment #6
frank ralf commentedonly changed status
Frank
Comment #7
killes@www.drop.org commentedI'd like to have a real patch.
Comment #8
jdsaward commentedYes; perfect. Thank you Frank Ralf.
For those coming along later, here is how I activated the fix of #5
1. Copy the code into my theme file - template.php.
2. Alter the function name from 'theme_event_nodeapi' to 'phptemplate_event_nodeapi'.
3. Upload and test. Disappointment - does not work.
4. Clear the cache.
5. Aha. Perfect.
(This theme over-ride is only necessary until the fix finds it's way into the events module code.)
Comment #9
claudiu.cristeaA "clean" solution can be achieved with the Date API module. Unfortunately this module is contained in the Date (CCK) module.
If the developers of this module will decide to make this module dependent on Date API then something like this can be done:
Anyway... Date API brings a lot of amazing API features on manipulating, calculating and displaying dates, times and periods. I think that adding this module as a dependency to Event is "a must have". Maybe we can convince Date module maintainers to store Date API as a standalone module. There is no reason to spend huge resources on Event module to build the date/time API infrastructure while this is very well handled in Date API. The above code works very well in my box...
To be more "elegant" the formatting must occur in
event_nodeapi()by applying the above solution to$node->event['start_format']and$node->event['end_format'].Comment #10
killes@www.drop.org commentedI'd rather have a patch to fix this bug rather than a lecture about Date API...
Comment #11
claudiu.cristeaA patch based on the above code means creating first a dependency to Date API. I will provide a patch as soon as you agree to add this module as dependency to Event.
Comment #12
claudiu.cristeaHere's the patch
Comment #13
claudiu.cristeaAnd to be more consistent... changed also
$node->event['start_time_format']and$node->event['end_time_format'].Comment #14
domesticat commentedPatch didn't apply cleanly for me, but it was simple enough to do it by hand.
I can't speak for the larger implications of the patch, but it solves the problem for me. Thanks for creating it.
Comment #15
killes@www.drop.org commentedSorry, but I am not going to make event depend on date for just a simple helper function. Please recreate a simple "strip off hour" function for this purpose.
Comment #16
frank ralf commentedI strongly agree with the opinion expressed in #9.
Handling date/time (and timezones) is a very complex task and quite error-prone.
Drupal stores and processes date/time data in quite a lot of different formats: Unix Timestamp format for internal processing, Datetime format for storing in the database, strings for human readable output, arrays for anything in between...
That's the reason, that there's a lot of "imploding" and "exploding" (via the respective PHP functions) and other converting going on under the hood of Event module.
I think a cleaner implementation for Event module would be to hand off the complexity of date/time processing to Date API, where it belongs, and concentrate on its main task of managing Event nodes.
Comment #17
killes@www.drop.org commentedThis is now fixed, there's now two variables, one for the date (Y-m-d) and one for the time.