Sha256: 6db4ada18c41e3b65ec02ee9d434a866b20684ccf0f133b176fe2f3c84e937c2

Contents?: true

Size: 448 Bytes

Versions: 13

Compression:

Stored size: 448 Bytes

Contents

# frozen_string_literal: true

module Dsu
  module Support
    module TimeComparable
      TIME_COMPARABLE_FORMAT_SPECIFIER = '%Y%m%d'

      def time_equal?(other_time:)
        time_equal_compare_string_for(time: time) == time_equal_compare_string_for(time: other_time)
      end

      def time_equal_compare_string_for(time:)
        time = time.in_time_zone

        time.strftime(TIME_COMPARABLE_FORMAT_SPECIFIER)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dsu-2.4.4 lib/dsu/support/time_comparable.rb
dsu-2.4.3 lib/dsu/support/time_comparable.rb
dsu-2.4.2 lib/dsu/support/time_comparable.rb
dsu-2.4.1 lib/dsu/support/time_comparable.rb
dsu-2.4.0 lib/dsu/support/time_comparable.rb
dsu-2.3.2 lib/dsu/support/time_comparable.rb
dsu-2.3.1 lib/dsu/support/time_comparable.rb
dsu-2.3.0 lib/dsu/support/time_comparable.rb
dsu-2.2.2 lib/dsu/support/time_comparable.rb
dsu-2.2.1 lib/dsu/support/time_comparable.rb
dsu-2.2.0 lib/dsu/support/time_comparable.rb
dsu-2.2.0.rc.2 lib/dsu/support/time_comparable.rb
dsu-2.2.0.rc.1 lib/dsu/support/time_comparable.rb