Skip to content

Commit

Permalink
Make times in lists in admin respect timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hank committed Dec 8, 2022
1 parent 6362f3c commit fe9b5e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). It uses [CalVer](https://calver.org/) as of May 2019.

## [22.12a](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.12a) - 2022-12-08
### Fixed
* Made times in lists in the `admin` respect the custom timezone.

## [22.12](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.12) - 2022-12-08
### Changed
* Upgraded the `rails_admin` gem to `3.x`.
Expand Down
8 changes: 8 additions & 0 deletions app/assets/stylesheets/rails_admin/custom/theming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,11 @@ aside#redaction-tools {
margin-right: 10px;
}
}

// Layout
//************************************************************************//
.rails_admin {
.sidebar {
flex-wrap: nowrap;
}
}
1 change: 0 additions & 1 deletion config/initializers/rails_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
field :body
field :entities
field :topics
field :works
field :url_count
field :action_taken
field :reviewer_id
Expand Down
6 changes: 5 additions & 1 deletion lib/rails_admin/config/fields/types/datetime_timezoned.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module DatetimeTimezoned
CUSTOM_RA_TIMEZONE = 'Eastern Time (US & Canada)'.freeze

# Convert to the RA custom timezone
def form_value
def value
return super if date_class?

value_in_default_time_zone = bindings[:object].send(name)
Expand All @@ -22,6 +22,10 @@ def form_value
)
end

def form_value
value
end

# Convert back to the default app timezone
def parse_input(params)
return super if date_class?
Expand Down

0 comments on commit fe9b5e1

Please sign in to comment.