lib/lookbook/param.rb in lookbook-2.0.0.beta.9 vs lib/lookbook/param.rb in lookbook-2.0.0.rc.1

- old
+ new

@@ -23,10 +23,16 @@ def input @input || guess_input end def value - @value || value_default + val = @value || value_default + if value_type == "datetime" + formatter = (input == "datetime-local") ? "%Y-%m-%dT%T" : "%Y-%m-%d" + StringValueCaster.call(val, "datetime").strftime(formatter) + else + val + end end def value_type @value_type || guess_value_type end