Skip to content

Commit

Permalink
Allow nil as datetime param value
Browse files Browse the repository at this point in the history
  • Loading branch information
allmarkedup committed Sep 23, 2023
1 parent 128ad63 commit 317fda7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lookbook/param.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def value
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)
StringValueCaster.call(val, "datetime")&.strftime(formatter)
else
val
end
Expand Down

0 comments on commit 317fda7

Please sign in to comment.