guyboertje/jrjackson — pull request #27 by colinsurprenant (2014-06-11 01:14:04+00:00)
Title: configurable date format in serialization

`JrJackson::Json.dump` and `JrJackson::Raw.generate` now support an options Hash with the `date_format` and `timezone` options.

- previous & default behaviour
```ruby
JrJackson::Json.dump({"time" => time})
#=> "{\"time\":\"2014-06-10 18:18:40 EDT\"}"
```
- with `date_format` options
```ruby
JrJackson::Json.dump({"time" => time}, :date_format => "yyyy-MM-dd'T'HH:mm:ss.SSSZ")
#=> "{\"time\":\"2014-06-10T18:18:40.000-0400\"}"
```

- with `date_format` and `timezone` options
```ruby
JrJackson::Json.dump({"time" => time}, :date_format => "yyyy-MM-dd'T'HH:mm:ss.SSSX", :timezone => "UTC")
#=> "{\"time\":\"2014-06-10T22:18:40.000Z\"}"
```

The `date_format` syntax is defined in `java.text.SimpleDateFormat` and the `timezone` in `java.util.TimeZone.getTimeZone()`

If you want to moveon with this, I can also add doc in the README file.