jeudi 14 septembre 2017

Timing issue in active admin

With in admin panel when I create a new user at 11.00 am as per my local timing is shows user created at 5:47. I found one solution config.time_zone = 'Eastern Time (US & Canada)' and second

before_filter :set_time_zone

private
  def set_time_zone
    Time.zone = current_user.time_zone if current_user
  end

problem with the 1st solution, if admin users are from different time-zones then it will not worked and second solution with in active admin instead of current user current_admin_user available and current_admin_user.time_zone is not working.

Aucun commentaire:

Enregistrer un commentaire