-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
Render Local Time #5190
Render Local Time #5190
Conversation
Can you add this to a random view in your local app without committing and take a screenshot? |
browser_tz = ActiveSupport::TimeZone.find_tzinfo(cookies[:browser_time_zone]) | ||
ActiveSupport::TimeZone.all.find { |zone| zone.tzinfo == browser_tz } || Time.zone | ||
rescue TZInfo::UnknownTimezone, TZInfo::InvalidTimezoneIdentifier | ||
@time_zone = Time.zone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need this from the client. Can you add this as a parameter for the component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @FireLemons, this is the local time zone of the user taken from browser. The arguments required for the component and mentioned in the issue are the time in unix timestamp format, and the format. So do I need to pass the time zone as the third argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's from the client
Oh my bad. I didn't know |
What github issue is this PR for, if any?
Resolves #5134
What changed, and why?
We created a new view component named LocalTimeComponent. This component renders user local time.
How is this tested? (please write tests!) 💖💪
Component is tested with both positive and negative tests.