Reputation: 564
I have two HTML date pickers that I am having trouble with. What I am trying to do is set the value and apply a minimum and maximum criteria with Knockout. After much research I found the proper date format for the proper format for value, min, and maximum. Trouble is, the min and max does not seem to work.
Here is my HTML date picker:
<input type="date" data-bind="value: MinDate, min: MinDateRange, max: MaxDateRange" />
The format of all the dates is yyyy-MM-dd in accordance with the link I sent. If I manually apply the min and max as attributes the date format works just fine. Anyone have any idea what I am doing wrong?
Upvotes: 3
Views: 2040
Reputation: 4073
You can't just use min
and max
because there is no such bindingHandlers. But you can use attr bindingHandler:
<input type="date" data-bind="value: MinDate, attr: { min: MinDateRange, max: MaxDateRange }" />
Upvotes: 3