Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #1069
Closed
Open
Issue created Jan 15, 2018 by Administrator@rootContributor

Default timezone is better to be Rails.application.config.time_zone

Created by: nao58

Hi,

I've just realized this change https://github.com/thoughtbot/administrate/pull/1009 and in trouble now. My datetime field's timezone is in local on input form, utc on view after the gem has updated. To solve this, I should add with_options to ALL current datetime fields.

I think the default timezone is better not to be fixed UTC but rails default configuration, something like this: https://github.com/thoughtbot/administrate/blob/29166a33cdd4f09df3fe8d7aa330503e2d90343d/lib/administrate/field/date_time.rb#L27

def timezone
  options.fetch(:timezone, Rails.application.config.time_zone || "UTC")
end

How do you find it?

Assignee
Assign to
Time tracking