Closed (fixed)
Project:
Date
Version:
6.x-2.6
Component:
Date CCK Field
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2010 at 15:18 UTC
Updated:
25 Oct 2010 at 03:30 UTC
I'm not sure what to call this, but I'm seeing if this is possible with Date or if it has to be done with php code.
This view. http://test.toledobendlakecountry.com/fishing/all_lunkers_year is grouped by the year in the date field. I created a date format that is just year and grouped the views table on that field.
The issue is that they use a seasonal year or fiscal year for chart placement. For example if the fish is caught in September of 09 it gets grouped with the 2010 grouping, if it was caught July 09 it's in the 2009 grouping.
I was thinking I would use the Views Custom Field to use PHP to return the correct year and group on that, but is it possible within Date as it is?
Comments
Comment #1
satcom74 commentedThis is what worked for me for anyone that needs to do anything similar. I used the Views Custom Field module (http://drupal.org/project/views_customfield), to insert php code into my view. I'll know tomorrow if I was understanding my customers request correctly. I converted the date field into two variables a month-day and four digit year. If it's less than or equal to 530 (May 30th) then it will subtract one from the year other wise it just echo's the year as it is.
This was the best way I could think of handling this but if anyone has any ideas, feel free to post them.