diff options
Diffstat (limited to 'app/models/query.rb')
-rw-r--r-- | app/models/query.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index 1e8080b86..1aa09d2a2 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -71,11 +71,31 @@ class QueryColumn object.send name end + # Returns the group that object belongs to when grouping query results + def group_value(object) + value(object) + end + def css_classes name end end +class TimestampQueryColumn < QueryColumn + + def groupable + if @groupable + Redmine::Database.timestamp_to_date(sortable, User.current.time_zone) + end + end + + def group_value(object) + if time = value(object) + User.current.time_to_date(time) + end + end +end + class QueryAssociationColumn < QueryColumn def initialize(association, attribute, options={}) |