-
Notifications
You must be signed in to change notification settings - Fork 49
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
Non-UTC timezone issue #247
Comments
What's your model code? How did you declare your attributes? |
Sorry to not have provided my code 😞. Here it is: class Request
include NoBrainer::Document
before_create :populates_created_at
field :url, type: String
field :created_at, type: Time, index: true
private
def populates_created_at
self.created_at = Time.zone.now
end
end |
Thank you. Example:
What do you get? The settings of the Rails time_zone is not taken in account. Maybe we can have another setting that uses the Rails configuration instead? The place to add this code is here: https://github.com/nviennot/nobrainer/blob/master/lib/no_brainer/document/types/time.rb#L35 Feel free to make a pull request :) :) |
I'm done with AASM, if you want to have a look and give feedbacks: aasm/aasm#522. I will now check for this timestamp issue. |
Great work! I put a few comments in the pull request |
Thank you @nviennot. Where are your comments? I can't see them. |
Forgot to press "submit review". Should be in |
Time
records attributes of my application are saved in UTC in RethinkDB, which is fine by me, but now I'd like to show them in the current timezone.I have updated my Rails app
config/application.rb
file in order to set thetime_zone
:And I have updated the NoBrainer initializer:
Restarted everything but my dates and times are still displayed in UTC:
(This should be with an hour more 11:31:56)
Can you please tell me what am I doing wrong?
The text was updated successfully, but these errors were encountered: