Sha256: e35f036abb36babe094be9ef165eafad1a6c11d860f8bc85bd88cd74ead2ecce

Contents?: true

Size: 292 Bytes

Versions: 8

Compression:

Stored size: 292 Bytes

Contents

def with_date_format(format = "%m/%d/%Y")
  begin
    old_format = Datagrid.configuration.date_formats
    Datagrid.configure do |config|
      config.date_formats = format
    end
    yield
  ensure
    Datagrid.configure do |config|
      config.date_formats = old_format
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
datagrid-1.0.3 spec/support/configuration.rb
datagrid-1.0.2 spec/support/configuration.rb
datagrid-1.0.1 spec/support/configuration.rb
datagrid-1.0.0 spec/support/configuration.rb
datagrid-0.9.3 spec/support/configuration.rb
datagrid-0.9.2 spec/support/configuration.rb
datagrid-0.9.0 spec/support/configuration.rb
datagrid-0.8.4 spec/support/configuration.rb