This project is archived and is in readonly mode.

#2605 ✓duplicate
Adam Hooper

ActiveSupport::JSON parses dates

Reported by Adam Hooper | May 4th, 2009 @ 07:42 PM | in 2.x

h = { 'd' => '2009-05-04' } => {"d"=>"2009-05-04"} >> ActiveSupport::JSON.decode(h.to_json) => {"d"=>Mon, 04 May 2009}

The expected result, of course, is that h == ActiveSupport::JSON.decode(h.to_json).

JSON does not support dates. Sure, one could say that sucks. But it's not half as sucky as ActiveSupport::JSON's invalid support of String :).

We should either:

  1. Call Rails's interchange format "ASJSON" or something else which makes it obvious we do not conform to the JSON specification; or
  2. Conform to the JSON specification.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages