This project is archived and is in readonly mode.

#3031 ✓resolved
Bas van Klinkenberg

[PATCH] AS::JSON#decode does not parse xmlschema date strings to Time objects.

Reported by Bas van Klinkenberg | August 10th, 2009 @ 06:41 PM

ActiveSupport::JSON.decode automatically parses datestrings in json to Time objects, but fails to do so with xmlschema datetime notation (e.g. "2009-08-10T19:34:24+02:00"). Instead it returns a string rather than a Time object.

This used to work in rails 2.1.2, before the json gem/yaml backend split.

I've added 3 test cases (utc, positive and negative time zone) and a very simple fix in the date regexp (which adds the eventual T between date and time in the regexp).

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>

People watching this ticket

Referenced by

Pages