clemens/delocalize — pull request #34 by ralph (2011-11-14 21:15:28+00:00)
Title: support for switching the locale in the fly while parsing dates

Hey,

we had one problem with delocalize, which is changing the locale while parsing dates. The LocalizedDateTimeParser caches the formats used in an instance variable called @input_formats. But this instance variable still returns the old format after switching the locale.

This patch fixes just that, so that the formats are now scoped by locale inside of the @input_formats instance variable. This allows you to switch the locale while parsing dates, and still get the correct result.

Regards
Ralph