Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crack 0.4.3 cannot parse two consecutive dates #58

Closed
ypolonsky opened this issue Feb 8, 2016 · 1 comment · Fixed by #77
Closed

Crack 0.4.3 cannot parse two consecutive dates #58

ypolonsky opened this issue Feb 8, 2016 · 1 comment · Fixed by #77

Comments

@ypolonsky
Copy link

ypolonsky commented Feb 8, 2016

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.

@bf4
Copy link
Collaborator

bf4 commented Oct 30, 2020

Yup. It's a bug

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants