Class: TimestampQueryColumn

Inherits:
QueryColumn show all
Defined in:
app/models/query.rb

Instance Attribute Summary

Attributes inherited from QueryColumn

#default_order, #groupable, #name, #sortable, #totalable

Instance Method Summary collapse

Methods inherited from QueryColumn

#caption, #css_classes, #frozen?, #initialize, #inline?, #sortable?, #value, #value_object

Methods included from Redmine::I18n

#current_language, #day_letter, #day_name, #find_language, #format_date, #format_hours, #format_time, included, #l, #l_hours, #l_hours_short, #l_or_humanize, #languages_options, #ll, #lu, #month_name, #set_language_if_valid, #valid_languages

Constructor Details

This class inherits a constructor from QueryColumn

Instance Method Details

#group_by_statementObject



96
97
98
# File 'app/models/query.rb', line 96

def group_by_statement
  Redmine::Database.timestamp_to_date(sortable, User.current.time_zone)
end

#group_value(object) ⇒ Object



100
101
102
103
104
# File 'app/models/query.rb', line 100

def group_value(object)
  if time = value(object)
    User.current.time_to_date(time)
  end
end

#groupable?Boolean

Returns:

  • (Boolean)


92
93
94
# File 'app/models/query.rb', line 92

def groupable?
  group_by_statement.present?
end