When repeat options is set on a date the format of it is totally uncontrolled.

In my case (Hungarian) it looks like this: vas Dec 07 2008.
The first should be vasárnap, where only the first 3 characters show up: vas.
Not to mention that in drupal I have a complete different date format, where the year is the first following the month and day.

Is there any way to set the format of the repeating dates?

CommentFileSizeAuthor
#5 date-rrule-theming-patch.diff1.71 KBkeinstein
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not sure where you're seeing anything that is not using the format you selected. Unless you're talking about the way they look in the repeat rule description. If that's what you mean, I'm not sure how much more flexible I can make it. It's really really really hard to create that description by parsing the RRULE and the current handling is probably as good as I can do.

elektro’s picture

Yes, I was talking about how it appeared in the repeat rule description.

I just upgraded to the 6.x-2.0 version.
I would like to see the repeats like this: 2009.03.01 - 2009.03.22
How can I set this?

I selected "Display and To dates", but it only shows me the start date: 2009.03.01

gpk’s picture

Version: 6.x-2.0-rc6 » 6.x-2.x-dev
Category: task » bug
Status: Postponed (maintainer needs more info) » Active

The issue I'm seeing is that when I configure the repeating date field I get a fixed list of 14 entries in the "Input format" dropdown. Whereas if the field is *not* a repeating date field then I get a much longer list (probably about 200 options).

Also I previously (when running 2.0-rc6) tried to share the date field across 2 content types, and on one I used the basic Date Pop-up widget, and on the 2nd used the Date Pop-up with Repeat Options widget. Got lots of protestations in red at this point. Not sure if it was related. I fixed it by using a separate content type/field for repeating events. The error was:

Unknown column 'delta' in 'field list' query: INSERT INTO content_field_date (vid, nid, delta, field_date_value, field_date_value2) SELECT vid, nid, 0, field_date_value, field_date_value2 FROM content_type_event in /home/gelstgpk/public_html/shw-dev/modules/acquia/cck/includes/content.admin.inc on line 1506.

keinstein’s picture

Status: Active » Needs work

If I understand elektro right, I have the same problem. It's easy to make it better.

The problem is that the repeat rule description das not honour any of the configured date formats.
Usually this should be configured independently from the date format used for the field. But as a start, we can use the same one:

Just change the code around Line 82 in date.theme to

  // Check the formatter settings to see if the repeat rule should be
  // displayed. Show it only with the first multiple value date.
  if (!in_array($node->nid, $repeating_ids) && module_exists('date_repeat') 
  && !empty($item['rrule']) && $options['repeat']['show_repeat_rule'] == 'show') {
        	  $formatter = $element['#formatter'];
        	  $format = date_formatter_format($formatter, $field_name);
    require_once('./'. drupal_get_path('module', 'date') .'/date_repeat.inc');
        	  $output .= theme('date_repeat_display', $field, $item, $node, $format);
    $repeating_ids[] = $node->nid;
  }

The indented lines are those which I changed/inserted.

This solution is still not correct, as it shows the time even if the granularity of the rrule is weaker than days.

keinstein’s picture

Status: Needs work » Needs review
FileSize
1.71 KB

Patch attached.

vitis’s picture

sub

BWPanda’s picture

Category: bug » feature

I have just setup a repeating date field and need to change the way it's output. I been doing some thinking about how to theme repeating date fields (since the current theme functions aren't sufficient) and have the following proposals:

1. Change date_repeat_rrule_description() to a theme function so users can change the way the RRULE is output (e.g. 'Repeats every week' without listing the end date). A lot of the code could be moved to a preprocess function for the new theme function so as not to overwhelm users with code they don't need to change, just keep what's needed to configure the actual output.

2. Create a new theme function that lets users configure the output of the date field as a whole (e.g. output the repeat rule before, inline with, or after the list of dates).

With the above changes, I believe the 'Repeats' tab on nodes shouldn't be affected at all, since that can be linked to for a full description of the repeating dates, especially when you theme the repeating date field to only show a summary of the RRULE (e.g. "16/08/2010 (repeats weekly)").

Thoughts?

mattiasj’s picture

Great ideas, any news on this? I would like to customize the date format for the repeating text in my views.

cpelham’s picture

I need this functionality and flexibility as well.

cimo75’s picture

+1

milos.kroulik’s picture

I think this is very important for non-english websites.

The patch above would need a huge overhaul to be usable.

amaisano’s picture

Issue summary: View changes

Also interested in this. I'd rather be able to control/change this:

Repeats every week every Wednesday until June 15, 2015

to be output as

Every Wednesday until June 15, 2015

without hacking the date_repeat_rrule_description() output in the module.

dalemoore’s picture

I was able to do this (customizing the repeat rules) using the Custom Formatters module. https://www.drupal.org/project/custom_formatters

DamienMcKenna’s picture

Status: Needs review » Closed (won't fix)

Unfortunately the D6 version of this module is no longer supported, but we appreciate the time you put into this. If this problem is relevant for D7 too, please reopen the issue. Thanks.