Class: Locomotive::Steam::Server::Timezone

Inherits:
Middleware
  • Object
show all
Defined in:
lib/locomotive/steam/server/timezone.rb

Overview

Set the timezone according to the settings of the site

Instance Attribute Summary

Attributes inherited from Middleware

#app, #content_entry, #liquid_assigns, #mounting_point, #page, #path, #request

Instance Method Summary collapse

Methods inherited from Middleware

#initialize

Constructor Details

This class inherits a constructor from Locomotive::Steam::Server::Middleware

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/locomotive/steam/server/timezone.rb', line 8

def call(env)
  self.set_accessors(env)

  Time.use_zone(site.try(:timezone) || 'UTC') do
    app.call(env)
  end
end