How to create a custom Date Formatter for grouping in Views? I have a view of content type "event". One of the fields is a category of the event which is a taxonomy list and i have a field for the date and time the event takes place.

Now i have set up the view showing the events in a time period i can set through an exposed filter, grouping the events by their date-field (nr.1) and as a second group field by the category (nr.2). 

I am sorting this view with the event-field (ascending) as the first sort criteria and Taxonomy term: Weight as the second sort criteria. 

It works as designed, but every event that shares the same time on a given date creates an own group row:

Like this:


Category-Name  


4/12/2013  


Event1 12.00h  
Event2 12.00h  

4/12/2013 


Event3 13.00h

4/12/2013


Event5 14.00h  
Event6 14.00h




What i want to achieve is this:


Category-Name  


4/12/2013  


Event1 12.00h  
Event2 12.00h   
Event3 13.00h
Event5 14.00h  
Event6 14.00h




Question: is it possible to have a formatter that has stripped out the time, so i can group by date only?

Of course i tried a custom display formats for the date beforehand, but this doesn't affect the grouping.

EDIT: the hint about the RDF module helped partly with this issue. I could remove the extra markup in the date field. Nevertheless the sorting of the date field still takes the time of the event into account. There's another sorting i didn't mentioned in the first place, cause I didn't expect it to be relevant.

The location of an events is referenced as entity and also added to a row of an event and sortet by title (asc). Now the date-field is superceding the title of the location, because the event-time is still taken into account.

I had started another question on this other issue, but actually think it belongs here. I still need to strip out the time somehow...
Views uses the rendered value for the field, including the field wrappers to do grouping. In your case, views is treating each date field differently.

There are 3 ways this can be fixed. One of the following methods should do it.


Remove the tags from the rendered output.


Using a custom template and a preprocess function, you can strip all markup and print the output only.


views-view-fields.tpl.php 
template_preprocess_views_view_field

Turn off the RDF module. Views will take care of the grouping itself. The RDF module adds extra metadata to your markup, which makes views separate the grouping as shown in your example above instead of grouping the similar dates together.