crack icon indicating copy to clipboard operation
crack copied to clipboard

Crack 0.4.3 cannot parse two consecutive dates

Open ypolonsky opened this issue 10 years ago • 1 comments

Run the following code:

require 'crack'

class Launcher
  def initialize
  end

  def run
    strj = "{\"budget_start\":\"2014-02-28\",\"budget_end\":\"2014-02-20\"}"
    resp = Crack::JSON.parse(strj);
    print "\n"
  end
end

l = Launcher.new
l.run

It produces "Invalid JSON string" exception. Replace the strj string to: strj = "{\"budget_start\":\"2014-02-28\",\"budget_end\":\"2014\"}" It works fine.

ypolonsky avatar Feb 08 '16 18:02 ypolonsky

Yup. It's a bug

Crack::JSON.convert_json_to_yaml strj
=> "{\"budget_start\":!!timestamp \"2014-02-28\", \"budget_end\"!!timestamp  \"2014-02-20\"}"

bf4 avatar Oct 30 '20 01:10 bf4