Parsing YAML Dates in Rails Gives Surprising Results

Today's surprise was that "2009-01-01" and "2009-1-1" get parsed differently by the YAML parser in Rails. The former gets converted to a Date, while the latter becomes a String. It confused me for a while, as the problem only showed up when I wanted to send the dates to a Flot chart. Looking at the standard, it's conforming behaviour. Must be me that is non-conforming then...

Discuss this post here.

Published: 2009-03-07