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 »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Referenced by

Pages