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

Add per user time zone support #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Xu-Zhiqing
Copy link

No description provided.


private
def set_time_zone
Time.zone = current_user.time_zone if current_user and current_user.time_zone.present?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Time.zone = current_user.time_zone if current_user and current_user.time_zone.present?
Time.zone = current_user.time_zone if current_user&.time_zone&.present?

Copy link
Contributor

@Eric-Guo Eric-Guo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need add the DB migrate file also.

Xu-Zhiqing added a commit to Xu-Zhiqing/cybros_core that referenced this pull request Aug 14, 2019
Xu-Zhiqing added a commit to Xu-Zhiqing/cybros_core that referenced this pull request Aug 14, 2019
@jasl
Copy link
Owner

jasl commented Aug 14, 2019

感谢你!最近稍微有一点忙,我会晚点时间处理

Xu-Zhiqing added a commit to Xu-Zhiqing/cybros_core that referenced this pull request Aug 14, 2019
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Wed Aug 14 17:45:34 2019 +0800
#
# On branch user-time-zone
# Your branch is up to date with 'origin/user-time-zone'.
#
# Changes to be committed:
#	modified:   app/controllers/application_controller.rb
#	new file:   db/migrate/20190809022738_add_user_time_zone.rb
#	new file:   db/migrate/20190814094307_add_user_time_zone.rb
#
# Changes not staged for commit:
#	deleted:    db/migrate/20190814094307_add_user_time_zone.rb
#
# Untracked files:
#	.generators
#	.idea/
#	.rakeTasks
#
Xu-Zhiqing added a commit to Xu-Zhiqing/cybros_core that referenced this pull request Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants