When using the field "Event: Start Time" and the handler "As Custom Date" no option field is availible to put in the custom php date formatting. Here is the transcript of the #drupal-sopport IRC conversation I had about this just in case in helps.

merlinofchaos: rickvug: The field should have an 'option' in the UI. Set the handler to 'custom' and in the option set a custom date string, like the php date() function takes.

robrechtj: rickvug: hmm, your right, there is no option for event dates

merlinofchaos: If the option field is not there, then it's a bug in event_views

robrechtj: probably not a bug in views, but an oversight in event_views?

merlinofchaos: In which case, look in event_views_views_tables() and in the 'field' definition for the date, add 'option' => 'string'

merlinofchaos: What's odd is I remember hearing about this bug and I thought KarenS fixed it

Comments

njehlen’s picture

I tried following this but didn't get it to work. If someone's succeeded in making custom dates work, could you post a patch or instructions? thanks!

karens’s picture

Sorry for the delayed response, I've been buried in other issues. The basic problem is that I used the option field as a way to allow a selection of dates. That worked fine until the date fields acquired options of their own in the latest cck updates. Now I'm out of places to put things so I need to re-work the way I put this all together and I haven't yet got it all figured out.

I apologize, but I'll try to get something working as soon as I can.

IGadmin’s picture

I'd like to cast another vote for a solution to the no "As Custom Date" option field, but respect your timetable.

Perhaps related to this is the lack of being able to sort tables meaningfully on Event: Start Time? I've got a series of events that I'd like to be able to show in chronologic order, but the only temporal variable I can add to sort criteria is Event: Start Time, and it appears to not return desired results if all the start times (i.e. minute and hours) are the same, regardless of what the event dates are.

karens’s picture

I apologize again, I've just been buried in other things. I haven't forgotten about this. Unfortunately cck kind of threw me a curve ball when it started using the option values. I hadn't been expecting other fields to use them and it's not going to be a trivial fix so I need some time to think it through.

merlinofchaos’s picture

Karen: You might be able to overload the option field with two fields and some form cleverness; but that depends on whether or not you can override CCK's use of the field.

Basically what you do is create a $form array with two fields. Using #process and #after_build, you can copy the values from #default_value of the 'main' part of the form into the #default_value of each individual element, which you're keeping in a serialized array, and then copy it into #value during processing. It's a spiffy trick that I've used in other places and am quite sure it can work here.

karens’s picture

Thanks for the idea, yes something like that is what I probably need. Now if I could just get my head around how #process and #after_build work....

merlinofchaos’s picture

If you want there is a (somewhat more complex) example of this sort of feature in acl.module (part of the na_arbitrator package)

havoc’s picture

Is this an event_views bug or is this really a views bug?

merlinofchaos’s picture

havoc: Clearly, the author of Views has no idea what he's talking about on this issue.

havoc’s picture

merlinofchaos: Heh! I'm a noob. I forgot too whom I was speaking. (I bow and scrape before you!) ;-)

karens’s picture

Status: Active » Fixed

OK, at long last I have this done and committed. You should be able to select any views field that handles dates and a format for the display of that field and display those dates in a calendar. It allows you to choose from the cck formatters for cck fields and the regular views date formatting options for other dates.

Now that this is working correctly for all dates, I am preparing to carve all the calendar features out of this module and put them in a separate views calendar module that is not dependent on the event module, since this now works for all kinds of date fields. I'll leave it in this module for a while to help the transition, but eventually everything related to displaying custom dates in calendars will be moved into a separate module.

Anonymous’s picture

Status: Fixed » Closed (fixed)