Input of type date to generate a date picker using Reagent in ClojureScript

I needed a date picker to use in ClojureScript application to enter date of birth.

I came across the pikaday  which I tried to use but the date range was limited and could not find a solution to not limit the date range.

The native HTML input control of type date can be generated in Reagent as follows

[:p "Enter Date Of Birth"]
;;using input control of type date to allow a date to be picked
[:input {:type "date"
:on-change (fn [e] (swap! pension-age assoc :dob (js/Date. (.-target.value e))))
}]

On the UI, the date picker

datePicker

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s