Sha256: 4c92c2d9ff133640498b61dd18e3133bc68801bd9ad38270f31234c990dbf9e3

Contents?: true

Size: 362 Bytes

Versions: 32

Compression:

Stored size: 362 Bytes

Contents

#
# Utility methods that alleviate the pain of dealign with timezones, midnight, etc...
#
class Sundial
  def self.in_time_zone(organization, time_string)
    ActiveSupport::TimeZone.create(organization.time_zone).parse(time_string)
  end

  def self.midnightish(organization, time_string)
    in_time_zone(organization, time_string) + 1.day - 1.minute
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.11 app/models/sundial.rb
artfully_ose-1.2.0.pre.10 app/models/sundial.rb
artfully_ose-1.2.0.pre.9 app/models/sundial.rb
artfully_ose-1.2.0.pre.8 app/models/sundial.rb
artfully_ose-1.2.0.pre.7 app/models/sundial.rb
artfully_ose-1.2.0.pre.6 app/models/sundial.rb
artfully_ose-1.2.0.pre.5 app/models/sundial.rb
artfully_ose-1.2.0.pre.4 app/models/sundial.rb
artfully_ose-1.2.0.pre.3 app/models/sundial.rb
artfully_ose-1.2.0.pre.2 app/models/sundial.rb
artfully_ose-1.2.0.pre.1 app/models/sundial.rb
artfully_ose-1.2.0.pre app/models/sundial.rb