Support datetime field type
jhodgdon - March 13, 2009 - 17:12
| Project: | CCK Facets |
| Version: | 6.x-1.x-dev |
| Component: | Date Facets |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
It looks to me as though the "datetime" field in the Date module (at least as of Date 6.x-2.0) is the field that is recommended to use.
CCK Facets doesn't currently support it, however.
So this is a request to add support for the "datetime" field in the CCK facets "CCK Date Facets" module.

#1
I'm going to work up a patch in the next few days for this.
#2
Scratch this!!
#3
That patch works except for the "fix me" section that I forgot about. It has to do with the block for "related categories" when you are viewing a node.
#4
#5
Sorry about that. This patch in #4 is the correct one to use.
I tested all the blocks in CCK Facets, and they all seem to be working with my "datetime" field now. When I attached that first patch, I didn't have the "related categories" block enabled, and that first patch didn't fix up that part of the code.
Tested under Drupal 6.10, Date 6.x-2.0, and CCK Facets 6.x-1.x-dev.
#6
Reading the code, it looks like the
datetime_facet_categoryis not needed (it only calls its parent's constructor, and does not override anything from the base class). It looks like using thedate_facet_categoryclass would do just the same. And then ifdate_facet_categorycan be used, it looks like thedatetime_facetclass won't be doing anything different from its parentdate_facetclass.So unless I am missing something, your handling of the 'datetime' field is the same as for the 'date' field. Am I right? If so, aren't there some differences between the two that would need to be taken into account? If not, then the superfluous classes should go away. :-)
#7
#8
I was wondering about that too. I had made a comment when I submitted the patch, but it got lost... Anyway, I agree that it is probably not necessary to have the new classes. I added them to be consistent with the other handling, but given the current functionality of date facets, the new classes are not necessary.
#9
Just a note that I decided not to use Date Facets, so updating this patch is probably not my highest priority right now.
One reason I decided not to use it is that for a repeating event, the "related categories" block that is shown on a node has a huge number of dates in it, in seemingly random order. I am not sure why the order is so bad, or why the related categories block is not respecting the settings I made on the facet environment (e.g. show only 10 date facets, and order by date), but that's probably a separate issue for Faceted Search.
Also I decided it made more sense to do date-related searches using a calendar rather than a list of date facets.