Module: TimezoneFilter

Defined in:
lib/liquidum/liquid/filters/timezone_filter.rb

Instance Method Summary collapse

Instance Method Details

#timezone(input, to_zone = 'UTC') ⇒ Object

Convert between timezones Inspired by: customer.io/docs/dates-timezones.html See: api.rubyonrails.org/classes/ActiveSupport/TimeZone.html

Examples:

date_time | timezone: ‘Europe/Amsterdam’ }

Changes like +3 or -4 or not (yet) possible



13
14
15
# File 'lib/liquidum/liquid/filters/timezone_filter.rb', line 13

def timezone(input, to_zone = 'UTC')
  input.utc.in_time_zone(to_zone)
end