Sha256: 0c0a5ff5c3552e8cd293c8a3ebec116634358f885719234a0de64b1b520ea5af

Contents?: true

Size: 334 Bytes

Versions: 5

Compression:

Stored size: 334 Bytes

Contents

class DateTime # :nodoc:
  RCAP_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S"
  RCAP_ZONE_FORMAT = "%+03i:00"

  alias inspect to_s

  def to_s_for_cap
    t = self.strftime( RCAP_TIME_FORMAT ) + format( RCAP_ZONE_FORMAT , utc_hours_offset )
    t.sub(/\+(00:\d\d)$/, '-\1')
  end

  private
  def utc_hours_offset
    self.offset * 24
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rcap-1.3.0 lib/extensions/date_time.rb
rcap-1.2.4 lib/extensions/date_time.rb
rcap-1.2.3 lib/extensions/date_time.rb
rcap-1.2.2 lib/extensions/date_time.rb
rcap-1.2.1 lib/extensions/date_time.rb