Our calendar includes various events that happen on a particular day but at no particular time (e.g., "school closed"). This can be implemented by setting their time arbitrariy, e.g. to 12AM, but this is a bit messy. I've modified event to offer a checkbox (see this feature request) that controls a "node->$notime" field indicating that "this event happens at no particular time"; in such cases the calendar and node views do not display any time at all when displaying the event. The change is minor (although the indicated line numbers won't be accurate, due to other changes I've made in the module).
>
226c226,229
< $output .= form_item(t('Start'), event_format_date($node->start));
---
> $output .= form_item(t('Start'),
> $node->notime ?
> event_format_date($node->start,'custom','D, m/d/Y') :
> event_format_date($node->start)) ;
342c345,348
< else {
---
> else if (in_array($def[0], array('checkbox','radio'))) {
> $output .= $function($def[1], $field, 1, $node->$field, $def[6]);
> }
> else { //apparently assumes field is form_select
355c361
< if ($node->$field) {
---
> if (isset($node->$field)) {
486c492,496
< $output .= '<span class="time">'. event_format_date($node->start, 'custom', $date_format) .'</span>';
---
> if ($node->notime) {
> $output .= '<span class="time">' .'</span>';
> } else {
> $output .= '<span class="time">'. event_format_date($node->start, 'custom', $date_format) .'</span>';
> }
<
Comments
Comment #1
fabiomora commentedi've tried that code in drupal 4.5.0, with event.module 4.5.0, and doesn't work for me.
a question: the cvs version of event.module include this patch?
is scheduled a new version with some pending requested feature?
thanks in advance
fab'
Comment #2
(not verified) commentedthe code here does not appear to be in the CVS version at this time.
Comment #3
downtown70 commentedkarger,
since your line numbers do not match those in original module, would you mind posting your entire code, please?
Comment #4
(not verified) commentedAs requested, I'm posting the entire code. But note that we've made various other changes; not clear it will work in your installation.
Comment #5
drewish commentedI'd like to see some kind of a precision variable attached to each timestamp. I think the "granularity" concept used by Flickr for photo taken dates could be interesting approach. I need to do a little thinking about it.
Comment #6
killes@www.drop.org commentedThis version of event.module is no longer supported. Please update your site. If the issue is still valid, don't hesitate to re-open it against a more recent version.