Skip to content

Reports doesn't takes timezone into account #9

@guiocavalcanti

Description

@guiocavalcanti

My current timezone is UTC -03:00 (also specified in config.time_zone), but reportable doesnt takes it into account.

For instance, in my model I defined reportable as follows:

class Topic < ActiveRecord::Base
    reportable :creation
end

When I call Topic.creation_report(:grouping => :hour, :limit => 6) the results are:

=> [[Wed, 05 Jan 2011 12:00:00 +0000, 0.0], [Wed, 05 Jan 2011 13:00:00 +0000, 0.0], [Wed, 05 Jan 2011 14:00:00 +0000, 0.0], [Wed, 05 Jan 2011 15:00:00 +0000, 0.0], [Wed, 05 Jan 2011 16:00:00 +0000, 0.0], [Wed, 05 Jan 2011 17:00:00 +0000, 1.0]]

Although, in my environment.rb I have config.time_zone = 'Brasilia', which means UTC -03:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions