Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reports doesn't takes timezone into account #9

Open
guiocavalcanti opened this issue Jan 5, 2011 · 1 comment
Open

Reports doesn't takes timezone into account #9

guiocavalcanti opened this issue Jan 5, 2011 · 1 comment

Comments

@guiocavalcanti
Copy link

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

@marcoow
Copy link
Contributor

marcoow commented Jan 12, 2011

I created a branch at https://github.com/saulabs/reportable/tree/time_zones and made some changes already. However, this probably won't be easily done.

For the moment, you just have to assume that the actual times should be correct and simply show the wrong zone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants