I needed to alter the way the start and end dates are displayed on the event page so rather than hardwire it in I added an option on the configuration overview page, here is a patch.

On another note, I also had a crash when I tried to export an ical, the cure was to add

  include_once(EVENT_PATH .'/ical.inc');

at the start of function event_calendar_ical().
I haven't looked any further but it may well be that the crash occurred because I have not implemented event types or set up any terms.

Hope this helps.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Frank Ralf’s picture

Status: Active » Needs review

only changed status to the appropriate one ;-)

killes@www.drop.org’s picture

Status: Needs review » Needs work

I've added the ical.inc include.

I am not inclided to apply the patch since I've added other formats to event 6.2 already:

        $format = event_strip_time(variable_get('date_format_short', 'm/d/Y - H:i'));
        $node->event['start_format'] = event_format_date($node->event['start_exploded'], 'small');
        $node->event['start_date_format'] = event_format_date($node->event['start_exploded'], 'custom', $format);
        $node->event['start_time_format'] = event_format_date($node->event['start_exploded'], 'custom', (variable_get('event_ampm', '0') ? 'g:i a' : 'H:i'));

I could backport this.

hutch’s picture

The event_date_display patch came about as a result of a customer complaint that the short date format was "too techie". Hmpf.

So I changed it and found it was being applied elsewhere as well and as the vast majority of datestamps are seen by admin (me) this is a pain.

As the events module is one of the few places that the general public will come across datestamps, I feel that having a greater flexibility over the way dates are displayed to the general public is important.

The patch makes the 'small' that's hardwired in configurable for the events display.
I can roll a 6.x-dev patch if it helps.

killes@www.drop.org’s picture

ok, if you provide a tested(!) D6 patch I'll commit this to both versions. The default for the format should still be "small" so that nothing changes for existing sites.

hutch’s picture

Great! I will roll patches for both, on DRUPAL-5--2 and HEAD. Tested of course.

hutch’s picture

Please find attached two patches, one for D5 and one for D6, both on this afternoon's CVS DRUPAL-5--2 and HEAD
The D5 one is much the same as before
The D6 patch is similar to D5 in respect of event.module. However the more advanced theming also needed tweaking to accept the changes. I have applied the changes to the day and nodapi in event.theme and the associated tpl.php files. I have left the other view-modes alone.
Two new variables have been added to the theming, $start_format which maps to $start_formatted and $end_format > $end_formatted.
Both patches have been tested on fresh installs in current stable versions of Drupal.

Hope this does the trick.

killes@www.drop.org’s picture

Thanks!

"I have left the other view-modes alone." <== shouldn't all of them display the times the same way?

I also think you missed a few places where date_format_short is called explicitly.

hutch’s picture

Having a long date format in the weekly or monthly displays would look awful, too squashed, but on the day or node display page it's fine and the developer can always change back to the short format by editing the relevant .tpl file. You *could* have the long format on the table display, to do that the following would have to be added to function template_preprocess_event_node_table in event.theme and the relevant .tpl file edited accordingly. (briefly tested)

around line 241

  $variables['start_formatted'] = $variables['node']->event['start_format'];
  $variables['end_formatted'] = $variables['node']->event['end_format'];

I'm trying to give the developer as many options as possible ;-)

BTW, glad to see datepicker in the loop ;-)

japerry’s picture

Status: Needs work » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.