Skip to content

Multiple Time.zone support #107

@Nerian

Description

@Nerian

Hi,

I am implementing reservation management now and I just noticed some weird behaviour when datatable is showing DateTime fields. The time (hours) part is showing correctly when the table is first initialised, but then when a filter is used the table actually shows times as if the timezone was UTC.

Which makes total sense since the Datatable Filter part is handled from a controller in EffectiveDatatable.

In my controllers this bit sets the Time.zone for the current account:

class ApplicationController < ActionController::Base
  around_action :set_time_zone, if: :current_account

  def set_time_zone
    Time.use_zone(current_account.time_zone) do
      yield
    end
  end

end

But that won't effect EffectiveDatatable::DatatablesController.

I was wondering how do you handle different time zones when using EffectiveDatatable.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions