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
Comment #1
njehlen commentedI 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!
Comment #2
karens commentedSorry 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.
Comment #3
IGadmin commentedI'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.
Comment #4
karens commentedI 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.
Comment #5
merlinofchaos commentedKaren: 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.
Comment #6
karens commentedThanks 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....
Comment #7
merlinofchaos commentedIf you want there is a (somewhat more complex) example of this sort of feature in acl.module (part of the na_arbitrator package)
Comment #8
havoc commentedIs this an event_views bug or is this really a views bug?
Comment #9
merlinofchaos commentedhavoc: Clearly, the author of Views has no idea what he's talking about on this issue.
Comment #10
havoc commentedmerlinofchaos: Heh! I'm a noob. I forgot too whom I was speaking. (I bow and scrape before you!) ;-)
Comment #11
karens commentedOK, 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.
Comment #12
(not verified) commented