DateParams

A simple Elixir library that use the Calendar library to convert values of a map into Elixir 1.3's native date types. This is especially useful when used as a plug to deal with user-inputted dates.

Example

  map = %{"date" => "2015-03-12"}
  DateParams.to_structs(map, [["date"]])
  #=>  %{"date" => ~D[2015-03-12]}

Using it as a plug

  defmodule Project.PageController do
    use Project.Web, :controller
    plug DateParams.Plug, [["vacation"], ["starts_at"], ["vacation"] ["ends_at"]] 
  end

Installation

If available in Hex, the package can be installed as:

  1. Add date_params to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:date_params, "~> 0.1.0"}]
end
```
  1. Ensure date_params is started before your application:
```elixir
def application do
  [applications: [:date_params]]
end
```

TODO