Sha256: da98849320a75780c313544d24b474f2975ed6c62f117c6f9daabaabd4f34a8f

Contents?: true

Size: 390 Bytes

Versions: 9

Compression:

Stored size: 390 Bytes

Contents

# frozen_string_literal: true

# Monkey patching the Ruby class DateTime
class DateTime
  # based on the fact that sunday is 'wday 0' plus that trading week starts
  #   sunday 0:00 (as trading starts sunday 5pm CT to fit tokyo monday morning)
  def to_seconds_since_sunday_morning
    wday * 86_400 + hour * 3600 + min * 60 + sec
  end

  alias to_sssm to_seconds_since_sunday_morning
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cotcube-helpers-0.1.7.4 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.7.3 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.7.2 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.7.1 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.7 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.6 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.5.4 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.5.1 lib/cotcube-helpers/datetime_ext.rb
cotcube-helpers-0.1.5 lib/cotcube-helpers/datetime_ext.rb