Added an initializer to monkey patch TimeWithZone. This is much easier then formatting times client side. This is probably not a good permanent solution.

pull/913/head
Richard 11 years ago
parent fa95edff15
commit 3b091d4296
  1. 3
      app/controllers/work_packages_controller.rb
  2. 5
      config/initializers/time_with_zone_as_json.rb

@ -452,7 +452,8 @@ class WorkPackagesController < ApplicationController
gon.project_identifier = @project.to_param gon.project_identifier = @project.to_param
gon.columns = @query.columns.map do |column| gon.columns = @query.columns.map do |column|
# TODO RS: Manually set all the column display types. We will need: # TODO RS: Manually set all the column display types. We will need:
# Text, Link, Date... what else? # Text, Link... what else?
# Date formatting is much easier server side. Check time_with_zone_as_json initializer.
display_type = if column.name == :subject display_type = if column.name == :subject
"work_package_link" "work_package_link"
else else

@ -0,0 +1,5 @@
class ActiveSupport::TimeWithZone
def as_json(options = {})
%(#{time.strftime("%m/%d/%Y/ %H:%M %p")})
end
end
Loading…
Cancel
Save