Sha256: cd0aeb2a703d57c47f69b23e5ada86086e5b128d5bcd20eacb90b9b6a5511806

Contents?: true

Size: 482 Bytes

Versions: 43

Compression:

Stored size: 482 Bytes

Contents

require 'date'
class Rack::App::Utils::Parser::DateTime
  def parse(str)
    ::DateTime.parse(str)
  end

  def validate(str)
    [
      /(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})[+-](\d{2})\:(\d{2})/,
      /^\w+, \d+ \w+ \d+ \d\d:\d\d:\d\d \+\d+$/,
      /^-?\d+-\d\d-\d\d\w\d\d:\d\d:\d\d\+\d\d:\d\d$/,
      /\w+ \w+ \d+ \d+ \d+:\d+:\d+ \w+\+\d+ \(\w+\)/,
      /^-?\d+-\d\d?-\d\d?\w\d\d?:\d\d?:\d\d?\w$/
    ].any? do |regexp|
      !!(str =~ regexp)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
rack-app-7.3.1 lib/rack/app/utils/parser/date_time.rb
rack-app-7.3.0 lib/rack/app/utils/parser/date_time.rb
rack-app-7.2.2 lib/rack/app/utils/parser/date_time.rb
rack-app-7.2.1 lib/rack/app/utils/parser/date_time.rb
rack-app-7.2.0 lib/rack/app/utils/parser/date_time.rb
rack-app-7.1.0 lib/rack/app/utils/parser/date_time.rb
rack-app-7.0.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.8.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.7.1 lib/rack/app/utils/parser/date_time.rb
rack-app-6.7.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.6.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.5.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.4.1 lib/rack/app/utils/parser/date_time.rb
rack-app-6.4.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.3.3 lib/rack/app/utils/parser/date_time.rb
rack-app-6.3.2 lib/rack/app/utils/parser/date_time.rb
rack-app-6.3.1 lib/rack/app/utils/parser/date_time.rb
rack-app-6.3.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.2.0 lib/rack/app/utils/parser/date_time.rb
rack-app-6.1.0 lib/rack/app/utils/parser/date_time.rb