PHP 5.2.5
Date 6.x-2.0-rc6
CCK 6.x-2.1
Views 6.x-2.1

I have added a custom Date field called "Program Schedule" to a node type called "Program". The Program node content type is for community centre programs. A program might run, for example, on every Monday from 1pm-2pm for 7 weeks.

I am trying to create a View that will display the node results as a table with Title, Start Date, End Date and time. I have managed to get Title, Start Date and Time working, but can't seem to find End Date (which would be the Repeat Until field I'm assuming) in Views.

So in views I have Basic Settings -> Style:Table and the arguments are for a taxonomy term.

When I go to add a field, the Repeat Until field does not show up in Views . These are the only ones that show up in the list:

Content: Program Schedule (field_program_schedule value)
Content: Program Schedule (field_program_schedule value2)

Is there a way to have the Repeat Until date field show up in the "add fields" section of Views?

Thanks,
J

Comments

KarenS’s picture

Title: Can't find "Repeat Until" field in Views » Expose "Repeat Until" field in Views
Category: support » feature

You can't find the UNTIL field because it isn't available as a Views field, but it would make sense to add it. So this is a feature request. No time to work on it now, though.

jlevis’s picture

It's turning out that I need this pretty bad. Not only for displaying the End Date in a View but also in order to use the Views Bulk Operations module to unpublish old nodes on a mass scale.

After much research, it looks like I'm going to try using the Computed Field Module to create a computed field that contains the Repeat Until date. Then hopefully that field will be available in Views to be used as an argument. I'm currently working my way through the Date Module functions to try to figure out what to put in the "Computed Code" area in order to extract that Repeat Until date.

Does anyone know the code for that off the top of their head (or can at least point me in the right direction)?

Here is my first guess:
==

$rrule_array = date_ical_parse_rrule($node->field_program_schedule[0]['rrule']);
$node_field[0]['value'] = $rrule_array['UNTIL'][datetime];

(where field_program_schedule is my custom CCK date field that has a repeat until value somewhere inside it)
==

Can anyone think of any alternative ways to do this?

Anonymous’s picture

I am also doing exactly that. Have a look at http://drupal.org/node/351276 (esp. #10 and #13) for some code to rip off, even if it does something a bit different.

ALSO watch timezone processing - I forgot that and it caused a lot of pain with Summer Time conversion.

Rgds, Tony

Exploratus’s picture

Is there a simple solution to displaying the repeat until date in views?

kentr’s picture

Assigned: Unassigned » kentr

Looking into this. I will submit a patch if I come up with something.

arlinsandbulte’s picture

Component: Date CCK Field » Code

Note: Marked #836382: Repeat until date filter for views as a duplicate of this issue.

Geijutsuka’s picture

Has there been any headway on this?

There is a desperate need for this in my department and I can't figure it out and I'm sadly not a good enough programmer to hack it out. How do you tell a view to not display a node if it's last repeating date is earlier than "now" when views can identify the last date? Seems it would be a very common use case....

Edit: To my knowledge, this functionality isn't even in Drupal 7

Edit2: Marked #571278: Views filter for repeating date? as a duplicate of this issue.

Geijutsuka’s picture

In my search for an answer to this question, I've found another duplicate that was "indiscriminately closed" a while back.
#894332: Accessing last event repeat date in Views

Anonymous’s picture

Issue summary: View changes

As part of an update to D7 earlier this year I replaced my previous hack with the Rules Module, and a rule which extracts the first and last date and sets two other fields accordingly whenever a node is updated.

I still think exposing both first and last dates (for filters as well as display) would be a useful feature to include in the base Date module.

Tony

Anonymous’s picture

Version: 6.x-2.0-rc6 » 7.x-2.8
echoz’s picture

I know this is a year old, but I can't find this solution anywhere.
Any tips to configure a rule or custom code would be greatly appreciated!

I have a view of nodes with a repeat date.

I want them to disappear when the "stop repeating" has past.

I successfully have the repeat date field showing one value, by filtering delta = 0.
They are not sorted by date.

kentr’s picture

Assigned: kentr » Unassigned