Commits

g...@13f79535-47bb-0310-9956-ffa450edef68  committed 6bed276 Draft

core trac change: grouping by datetime to group by days rather than time - for #68 (from olemis)

  • Participants
  • Parent commits c3d8ecb

Comments (0)

Files changed (1)

File trac/ticket/query.py

 from trac.ticket.api import TicketSystem
 from trac.ticket.model import Milestone, group_milestones
 from trac.util import Ranges, as_bool
-from trac.util.datefmt import format_datetime, from_utimestamp, parse_date, \
-                              to_timestamp, to_utimestamp, utc, user_time
+from trac.util.datefmt import format_date, format_datetime, from_utimestamp, \
+                              parse_date, to_timestamp, to_utimestamp, utc, \
+                              user_time
 from trac.util.presentation import Paginator
 from trac.util.text import empty, shorten_line, quote_query_string
 from trac.util.translation import _, tag_, cleandoc_
                     ticket['changed'] = True
             if self.group:
                 group_key = ticket[self.group]
+                # If grouping by datetime field use days (Bloodhound #68)
+                if self.group in ('changetime', 'time'):
+                    group_key = format_date(group_key)
                 groups.setdefault(group_key, []).append(ticket)
                 if not groupsequence or group_key not in groupsequence:
                     groupsequence.append(group_key)