Sha256: 22cfa669522570a8d43eee4d6a6fddd56ec135b99ffe0366336325f56ee6cfcb

Contents?: true

Size: 470 Bytes

Versions: 13

Compression:

Stored size: 470 Bytes

Contents

class Time
  
  def self.iso8601(time)
    cached_date_formatter("yyyy-MM-dd'T'HH:mm:ss'Z'").
      dateFromString(time)
  end

  private

  def self.cached_date_formatter(dateFormat)
    Thread.current[:date_formatters] ||= {}
    Thread.current[:date_formatters][dateFormat] ||= 
      NSDateFormatter.alloc.init.tap do |formatter|
        formatter.dateFormat = dateFormat
        formatter.timeZone   = NSTimeZone.timeZoneWithAbbreviation "UTC"
      end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bubble-wrap-1.3.0 motion/core/time.rb
bubble-wrap-1.3.0.osx motion/core/time.rb
bubble-wrap-1.2.0 motion/core/time.rb
bubble-wrap-1.2.0.pre motion/core/time.rb
bubble-wrap-1.1.5 motion/core/time.rb
bubble-wrap-1.1.4 motion/core/time.rb
bubble-wrap-1.1.3 motion/core/time.rb
bubble-wrap-1.1.2 motion/core/time.rb
bubble-wrap-1.1.1 motion/core/time.rb
bubble-wrap-1.1.0 motion/core/time.rb
bubble-wrap-1.0.0 motion/core/time.rb
bubble-wrap-1.0.0.pre.2 motion/core/time.rb
bubble-wrap-1.0.0.pre motion/core/time.rb