I am trying to bind a datepicker to my template property in knockout as per this example: http://jsfiddle.net/H8xWY/130/
From fiddler it looks pretty straightforward but the issue is that when I focus on date textbox the datepicker doesn't come up at all. There is no console errors neither. Not sure why nothing is happening and what I've missed?
My model:
var MyViewModel = function(model) {
var self = this;
self.date = ko.observable(new Date());
}
My template:
<div id="my-form">
<input data-bind="datepicker: date, datepickerOptions: { minDate: new Date() }" />
</div>
<script src="models/my-model.js" type="text/javascript"></script>
<script type="text/javascript">
var target = document.getElementById("my-form");
var data = @Html.Raw(Json.Encode(Model));
var myViewModel = new MyViewModel(data);
ko.applyBindings(myViewModel, target);
</script>