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.3.0.pre4 app/models/sundial.rb
artfully_ose-1.3.0.pre3 app/models/sundial.rb
artfully_ose-1.3.0.pre2 app/models/sundial.rb
artfully_ose-1.3.0.pre1 app/models/sundial.rb
artfully_ose-1.2.0 app/models/sundial.rb
artfully_ose-1.2.0.beta.1 app/models/sundial.rb
artfully_ose-1.2.0.alpha.2 app/models/sundial.rb
artfully_ose-1.2.0.alpha.1 app/models/sundial.rb
artfully_ose-1.2.0.pre.27 app/models/sundial.rb
artfully_ose-1.2.0.pre.26 app/models/sundial.rb
artfully_ose-1.2.0.pre.24 app/models/sundial.rb
artfully_ose-1.2.0.pre.23 app/models/sundial.rb
artfully_ose-1.2.0.pre.21 app/models/sundial.rb
artfully_ose-1.2.0.pre.20 app/models/sundial.rb
artfully_ose-1.2.0.pre.19 app/models/sundial.rb
artfully_ose-1.2.0.pre.18 app/models/sundial.rb
artfully_ose-1.2.0.pre.17 app/models/sundial.rb
artfully_ose-1.2.0.pre.16 app/models/sundial.rb
artfully_ose-1.2.0.pre.15 app/models/sundial.rb
artfully_ose-1.2.0.pre.12 app/models/sundial.rb